Skip to content

fix incoherent buffer regression #6075#6084

Merged
lgirdwood merged 3 commits intothesofproject:mainfrom
lyakh:dai
Aug 8, 2022
Merged

fix incoherent buffer regression #6075#6084
lgirdwood merged 3 commits intothesofproject:mainfrom
lyakh:dai

Conversation

@lyakh
Copy link
Collaborator

@lyakh lyakh commented Aug 4, 2022

The DMA buffer in dai.c has to use cached alias for access. Besides the pointer can be NULL, which has to be checked for.

@lyakh lyakh changed the title dai: acquire the DMA buffer for access [DRAFT][DO NOT MERGE]dai: acquire the DMA buffer for access Aug 4, 2022
@lyakh
Copy link
Collaborator Author

lyakh commented Aug 4, 2022

This is interesting: in dai_params() in the second half of the function a test is performed:

if (dd->dma_buffer) {

so presumably that function can be called with dd->dma_buffer == NULL because that's also the only location where that pointer is assigned. But in the beginning of dai_params() the ipc_dai_data_config() function is called, which for INTEL_ALH and AMD_DMIC DAI types does
dd->dma_buffer->stream.frame_fmt = dev->ipc_config.frame_fmt;

i.e. it dereferences the NULL pointer. And - guess what - there's no exception. To be more precise there wasn't one until today. Today after e4a5359 it began to properly crash according to #6075

lyakh added 2 commits August 5, 2022 15:44
The DMA buffer in dai.c has to use cached alias for access. Besides
the pointer can be NULL, which has to be checked for.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Failing to properly acquire buffer objects for access leads to a
CI regression.

BugLink: thesofproject#6075
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@marc-hb
Copy link
Collaborator

marc-hb commented Aug 5, 2022

This reverts commit
lyakh@9d37a33.
The regression is fixed, so CONFIG_INCOHERENT can be re-enabled.

Avoid double-negations and cherry-pick -x the original commit instead. Restore CONFIG_INCOHERENT...

@lyakh lyakh changed the title [DRAFT][DO NOT MERGE]dai: acquire the DMA buffer for access fix incoherent buffer regression #6075 Aug 5, 2022
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, agree with @marc-hb the double revert looks a little funny so best to cherry-pick !

@lyakh
Copy link
Collaborator Author

lyakh commented Aug 5, 2022

Kconfig options with no description cannot be selected from
defconfig. They can only be selected from other Kconfig options.
This means, that CONFIG_INCOHERENT doesn't get selected on TGL. Move
it to Kconfig to fix this.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh
Copy link
Collaborator Author

lyakh commented Aug 8, 2022

LGTM, agree with @marc-hb the double revert looks a little funny so best to cherry-pick !

@lgirdwood @marc-hb I thought having revert-revert would add context but ok, replaced with a cherry-pick

@lgirdwood lgirdwood merged commit b37a2f3 into thesofproject:main Aug 8, 2022
@lyakh lyakh deleted the dai branch August 8, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants