Skip to content

Commit 42bc62c

Browse files
tiwaibroonie
authored andcommitted
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: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2e6b836 commit 42bc62c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/xilinx/xlnx_formatter_pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component,
452452

453453
stream_data->buffer_size = size;
454454

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

0 commit comments

Comments
 (0)