From: Mark Brown Date: Mon, 26 Sep 2011 22:29:11 +0000 (+0900) Subject: ASoC: Flush Samsung DMA on free X-Git-Tag: next-20110927~98^2~6^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8b82cbb0ee18679da83b2b0dd17c525b93cb1c2d;p=karo-tx-linux.git ASoC: Flush Samsung DMA on free Ever since it was written the Samsung DMA driver has had a TODO in the hw_free() function wondering if we need to flush the DMA buffers. Up until now the answer has been no but with the recent improvements Boojin has done to the DMA infrastructure for the Samsung port the answer has changed to yes for at least S3C6410 systems. If we don't then when we next prepare() the channel the API will get confused trying to run callbacks on the transfers hanging around from the previous time the stream was open and oops. Signed-off-by: Mark Brown Signed-off-by: Kukjin Kim --- diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 851346f7d68d..2d622b635e68 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -198,10 +198,10 @@ static int dma_hw_free(struct snd_pcm_substream *substream) pr_debug("Entered %s\n", __func__); - /* TODO - do we need to ensure DMA flushed */ snd_pcm_set_runtime_buffer(substream, NULL); if (prtd->params) { + prtd->params->ops->flush(prtd->params->ch); prtd->params->ops->release(prtd->params->ch, prtd->params->client); prtd->params = NULL;