From fae9c0a600bf5f52f4a9ddaf8e2a12efa8288083 Mon Sep 17 00:00:00 2001 From: Puneet Saxena Date: Wed, 1 Nov 2017 17:00:36 +0530 Subject: [PATCH] sound: tegra: utils: replace dma_alloc_writecombine with coherent dma_alloc_writecombine forces non-cached memory irrespective HW module IO coherency. Use dma_alloc_coherent API, which selects the right memory type depending on HW module. Bug 2003170 Change-Id: I686713291c1469e67f7430550ad20c01028bf636 Signed-off-by: Puneet Saxena Reviewed-on: https://git-master.nvidia.com/r/1589979 Reviewed-by: Krishna Reddy GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/utils/tegra_pcm_alt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra-alt/utils/tegra_pcm_alt.c b/sound/soc/tegra-alt/utils/tegra_pcm_alt.c index 2b4f8593..8c431026 100644 --- a/sound/soc/tegra-alt/utils/tegra_pcm_alt.c +++ b/sound/soc/tegra-alt/utils/tegra_pcm_alt.c @@ -194,7 +194,7 @@ static int tegra_alt_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, { struct snd_pcm_substream *substream = pcm->streams[stream].substream; struct snd_dma_buffer *buf = &substream->dma_buffer; - buf->area = dma_alloc_writecombine(pcm->card->dev, size, + buf->area = dma_alloc_coherent(pcm->card->dev, size, &buf->addr, GFP_KERNEL); if (!buf->area) return -ENOMEM; @@ -219,7 +219,7 @@ static void tegra_alt_pcm_deallocate_dma_buffer(struct snd_pcm *pcm, int stream) if (!buf->area) return; - dma_free_writecombine(pcm->card->dev, buf->bytes, + dma_free_coherent(pcm->card->dev, buf->bytes, buf->area, buf->addr); buf->area = NULL; }