Skip to content

Commit

Permalink
ASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for C…
Browse files Browse the repository at this point in the history
…hainDMA

mainline inclusion
from mainline-v6.11-rc1

The DMA Link ID is only valid in snd_sof_dai_config_data when the
dai_config is called with HW_PARAMS.

The commit that this patch fixes is actually moved a code section without
changing it, the same bug exists in the original code, needing different
patch to kernel prior to 6.9 kernels.

Cc: [email protected]
Fixes: 3858464 ("ASoC: SOF: ipc4-topology: change chain_dma handling in dai_config")
Link: thesofproject/linux#5116
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit ae67ed9010a7b52933ad1038d13df8a3aae34b83)
Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
ujfalusi authored and opsiff committed Dec 7, 2024
1 parent db02bba commit dc31acb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sound/soc/sof/ipc4-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -2999,8 +2999,14 @@ static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
return 0;

if (pipeline->use_chain_dma) {
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID(data->dai_data);
/*
* Only configure the DMA Link ID for ChainDMA when this op is
* invoked with SOF_DAI_CONFIG_FLAGS_HW_PARAMS
*/
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID(data->dai_data);
}
return 0;
}

Expand Down

0 comments on commit dc31acb

Please sign in to comment.