Skip to content

Commit

Permalink
ASoC: xilinx: Fix reference to PCM buffer address
Browse files Browse the repository at this point in the history
commit 42bc62c upstream.

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: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210728112353.6675-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tiwai authored and gregkh committed Aug 18, 2021
1 parent c43e0f9 commit 4cf1b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/xilinx/xlnx_formatter_pcm.c
Expand Up @@ -452,8 +452,8 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component,

stream_data->buffer_size = size;

low = lower_32_bits(substream->dma_buffer.addr);
high = upper_32_bits(substream->dma_buffer.addr);
low = lower_32_bits(runtime->dma_addr);
high = upper_32_bits(runtime->dma_addr);
writel(low, stream_data->mmio + XLNX_AUD_BUFF_ADDR_LSB);
writel(high, stream_data->mmio + XLNX_AUD_BUFF_ADDR_MSB);

Expand Down

0 comments on commit 4cf1b08

Please sign in to comment.