]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend
authorShengjiu Wang <shengjiu.wang@nxp.com>
Mon, 20 Jan 2025 08:19:37 +0000 (16:19 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 20 Jan 2025 13:50:30 +0000 (13:50 +0000)
ASRC memory to memory cases and memory to peripheral cases are
sharing the same pair pools, the pairs got for m2m suspend
function may be used for memory to peripheral, which is handled
memory to peripheral driver and can't be handled in
memory to memory suspend function.

Use the "pair->dma_buffer" as a flag for memory to memory case,
when it is allocated, handle the suspend operation for the related
pairs.

Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20250120081938.2501554-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc_m2m.c

index 4906843e2a8fd1a08e22e5b7dfb6505b333ee1c3..ab9033ccb01e1c689771c7c0a71f7137f04f147f 100644 (file)
@@ -633,7 +633,7 @@ int fsl_asrc_m2m_suspend(struct fsl_asrc *asrc)
 
        for (i = 0; i < PAIR_CTX_NUM; i++) {
                pair = asrc->pair[i];
-               if (!pair)
+               if (!pair || !pair->dma_buffer[IN].area || !pair->dma_buffer[OUT].area)
                        continue;
                if (!completion_done(&pair->complete[IN])) {
                        if (pair->dma_chan[IN])