All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@kernel.org>, stable@vger.kernel.org
Subject: [PATCH 3/5] ASoC: xilinx: Fix reference to PCM buffer address
Date: Wed, 28 Jul 2021 13:23:51 +0200	[thread overview]
Message-ID: <20210728112353.6675-4-tiwai@suse.de> (raw)
In-Reply-To: <20210728112353.6675-1-tiwai@suse.de>

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>
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c
index 1d59fb668c77..91afea9d5de6 100644
--- a/sound/soc/xilinx/xlnx_formatter_pcm.c
+++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
@@ -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);
 
-- 
2.26.2


  parent reply	other threads:[~2021-07-28 11:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 11:23 [PATCH 0/5] ASoC: Fix reference to PCM buffer address Takashi Iwai
2021-07-28 11:23 ` [PATCH 1/5] ASoC: amd: " Takashi Iwai
2021-07-30 16:20   ` Mark Brown
2021-07-30 18:14     ` Takashi Iwai
2021-07-30 19:03   ` Mark Brown
2021-07-28 11:23 ` [PATCH 2/5] ASoC: intel: atom: " Takashi Iwai
2021-07-28 11:23   ` Takashi Iwai
2021-08-02  8:14   ` Cezary Rojewski
2021-07-28 11:23 ` Takashi Iwai [this message]
2021-07-28 11:23 ` [PATCH 4/5] ASoC: uniphier: " Takashi Iwai
2021-07-28 11:23 ` [PATCH 5/5] ASoC: kirkwood: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210728112353.6675-4-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.