summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2016-02-03 09:52:26 +0800
committerShengjiu Wang <shengjiu.wang@freescale.com>2016-02-04 17:24:33 +0800
commita4ff0e3c6dc9e8a7d02c6bbb8a818897738c6e1d (patch)
treeb59f91f08d97297a9b5bc6bf9bd65f81b91d81b8 /sound
parente75affffa39cdcfcf0b56e7aea2b1f2383ed6096 (diff)
MLK-12366: ASoC: dmaengine: fix sai underrun issue after suspend/resume
We use the devm_snd_dmaengine_pcm_register() for platform, don't use devm_snd_soc_register_platform(), their close funtion is different. One will release the dma channel, but another one won't release channel. When system enter suspend mode, alsa library is in draining state, it will not resume alsa driver in system resume, just call close directly. But the alsa driver is in state SNDRV_PCM_STATE_SUSPENDED, which is not a running state, so the trigger stop is not called, and dmaengine_terminate_all() is not called, then dma resource is not released. Which cause that in the next playback the sdma driver will not be started. Then there is a lot of SAI underrun error. If we use the devm_snd_soc_register_platform() for platfrom driver, there will be no issue, because it will release dma channel, release dma resource. But we use the devm_snd_dmaengine_pcm_register() for platform driver. So this patch is to add dmaengine_terminate_all() in the snd_dmaengine_pcm_close() to fix this issue. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit ff62968ea8c8b5414f3f049e61addcd4d2bec3b9)
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_dmaengine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index 29ce8ef61c88..e24758339373 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -5,7 +5,7 @@
* Based on:
* imx-pcm-dma-mx2.c, Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
* mxs-pcm.c, Copyright (C) 2011 Freescale Semiconductor, Inc.
- * imx-pcm-dma.c, Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+ * imx-pcm-dma.c, Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
* ep93xx-pcm.c, Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
* Copyright (C) 2006 Applied Data Systems
*
@@ -344,6 +344,7 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream)
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
dma_sync_wait_tasklet(prtd->dma_chan);
+ dmaengine_terminate_all(prtd->dma_chan);
kfree(prtd);