]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 24 Jul 2024 08:19:32 +0000 (11:19 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 24 Jul 2024 10:29:13 +0000 (11:29 +0100)
The DMA Link ID is set to the IPC message's primary during dai_config,
which is only during hw_params.
During xrun handling the hw_params is not called and the DMA Link ID
information will be lost.

All other fields in the message expected to be 0 for re-configuration, only
the DMA Link ID needs to be preserved and the in case of repeated
dai_config, it is correctly updated (masked and then set).

Cc: stable@vger.kernel.org
Fixes: ca5ce0caa67f ("ASoC: SOF: ipc4/intel: Add support for chained DMA")
Link: https://github.com/thesofproject/linux/issues/5116
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240724081932.24542-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c

index 4a4234d5c941daf531d6ce33723cfcc1a1310928..87be7f16e8c2b65e421739dc48b2f19db9d00548 100644 (file)
@@ -1358,7 +1358,13 @@ static void sof_ipc4_unprepare_copier_module(struct snd_sof_widget *swidget)
                ipc4_copier = dai->private;
 
                if (pipeline->use_chain_dma) {
-                       pipeline->msg.primary = 0;
+                       /*
+                        * Preserve the DMA Link ID and clear other bits since
+                        * the DMA Link ID is only configured once during
+                        * dai_config, other fields are expected to be 0 for
+                        * re-configuration
+                        */
+                       pipeline->msg.primary &= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
                        pipeline->msg.extension = 0;
                }