diff mbox series

[1/2] ASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend

Message ID 20250120081938.2501554-2-shengjiu.wang@nxp.com (mailing list archive)
State Accepted
Commit d12ca6d4c31bf974ecc80e36761488f41d05d18b
Headers show
Series ASoC: fsl: two fixes for asrc memory to memory | expand

Commit Message

Shengjiu Wang Jan. 20, 2025, 8:19 a.m. UTC
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>
---
 sound/soc/fsl/fsl_asrc_m2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Baluta Jan. 20, 2025, 9:09 a.m. UTC | #1
On Mon, Jan 20, 2025 at 10:20 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> 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>
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index 4906843e2a8f..ab9033ccb01e 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -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])