ipc4: dai: fix DMIC DMA link setup#10555
Open
serhiy-katsyuba-intel wants to merge 2 commits intothesofproject:mainfrom
Open
ipc4: dai: fix DMIC DMA link setup#10555serhiy-katsyuba-intel wants to merge 2 commits intothesofproject:mainfrom
serhiy-katsyuba-intel wants to merge 2 commits intothesofproject:mainfrom
Conversation
This prevents initializing unused members of struct dai_config with random garbage from the stack. In case some Zephyr DAI driver uses such an uninitialized member, it's better to have a bug with stable reproduction than a random one. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
There are two problems with out_fmt: (1) Audio format for gateway DMA data is sent either in copier's base.audio_fmt or out_fmt depending on gateway direction. DMIC is a capture gateway and its input pin format should be used to set up DMA link. UAOL gateway (coming soon) can be either capture or playback, hence the direction check is used. (2) The copier pointer in copier_dai_create() points to IPC memory window contents. However, out_fmt (now gtw_fmt) is also used when DAIs are resumed after exiting D3 state. So cd->config (a copy of ipc4_copier_module_cfg that is kept allocated throughout the copier module lifetime) is used to get the address of the audio format struct. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are two problems with out_fmt:
Audio format for gateway DMA data is sent either in copier's base.audio_fmt or out_fmt depending on gateway direction. DMIC is a capture gateway and its input pin format should be used to set up DMA link. UAOL gateway (coming soon) can be either capture or playback, hence the direction check is used.
The copier pointer in copier_dai_create() points to IPC memory window contents. However, out_fmt (now gtw_fmt) is also used when DAIs are resumed after exiting D3 state. So cd->config (a copy of ipc4_copier_module_cfg that is kept allocated throughout the copier module lifetime) is used to get the address of the audio format struct.