diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-08-19 17:29:45 +0200 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2021-08-26 08:37:10 -0400 |
commit | 846b0dc704552f467b2e221c9a93545006dc4bd8 (patch) | |
tree | bfcef46cc90b403fa845b9eb63c340f7b434fe42 /sound/soc | |
parent | 585015c16d69bceb074255350b4fc4fcabbc5f19 (diff) | |
download | linux-stable-846b0dc704552f467b2e221c9a93545006dc4bd8.tar.gz linux-stable-846b0dc704552f467b2e221c9a93545006dc4bd8.tar.bz2 linux-stable-846b0dc704552f467b2e221c9a93545006dc4bd8.zip |
ASoC: intel: atom: Fix breakage for PCM buffer address setup
[ Upstream commit 65ca89c2b12cca0d473f3dd54267568ad3af55cc ]
The commit 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM
buffer address") changed the reference of PCM buffer address to
substream->runtime->dma_addr as the buffer address may change
dynamically. However, I forgot that the dma_addr field is still not
set up for the CONTINUOUS buffer type (that this driver uses) yet in
5.14 and earlier kernels, and it resulted in garbage I/O. The problem
will be fixed in 5.15, but we need to address it quickly for now.
The fix is to deduce the address again from the DMA pointer with
virt_to_phys(), but from the right one, substream->runtime->dma_area.
Fixes: 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM buffer address")
Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/2048c6aa-2187-46bd-6772-36a4fb3c5aeb@redhat.com
Link: https://lore.kernel.org/r/20210819152945.8510-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index c877326cb0a6..96f7facd0fa0 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -135,7 +135,7 @@ static void sst_fill_alloc_params(struct snd_pcm_substream *substream, snd_pcm_uframes_t period_size; ssize_t periodbytes; ssize_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream); - u32 buffer_addr = substream->runtime->dma_addr; + u32 buffer_addr = virt_to_phys(substream->runtime->dma_area); channels = substream->runtime->channels; period_size = substream->runtime->period_size; |