Commit 42bc62c9 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: xilinx: Fix reference to PCM buffer address

PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer.  The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210728112353.6675-4-tiwai@suse.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e6b8363
...@@ -452,8 +452,8 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component, ...@@ -452,8 +452,8 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component,
stream_data->buffer_size = size; stream_data->buffer_size = size;
low = lower_32_bits(substream->dma_buffer.addr); low = lower_32_bits(runtime->dma_addr);
high = upper_32_bits(substream->dma_buffer.addr); high = upper_32_bits(runtime->dma_addr);
writel(low, stream_data->mmio + XLNX_AUD_BUFF_ADDR_LSB); writel(low, stream_data->mmio + XLNX_AUD_BUFF_ADDR_LSB);
writel(high, stream_data->mmio + XLNX_AUD_BUFF_ADDR_MSB); writel(high, stream_data->mmio + XLNX_AUD_BUFF_ADDR_MSB);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment