All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: Fix reference to PCM buffer address
@ 2021-07-28 11:23 Takashi Iwai
  2021-07-28 11:23 ` [PATCH 1/5] ASoC: amd: " Takashi Iwai
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

Hi,

while updating the memory allocation API for WC pages, I casually
stumbled on quite a few drivers dealing with the PCM buffer address
wrongly via substream->dma_buffer.addr.  This patch series corrects
those usages.


Takashi

===

Takashi Iwai (5):
  ASoC: amd: Fix reference to PCM buffer address
  ASoC: intel: atom: Fix reference to PCM buffer address
  ASoC: xilinx: Fix reference to PCM buffer address
  ASoC: uniphier: Fix reference to PCM buffer address
  ASoC: kirkwood: Fix reference to PCM buffer address

 sound/soc/amd/acp-pcm-dma.c                  |  2 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c          |  2 +-
 sound/soc/amd/renoir/acp3x-pdm-dma.c         |  2 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c |  3 +--
 sound/soc/kirkwood/kirkwood-dma.c            | 26 ++++++++++++++------
 sound/soc/uniphier/aio-dma.c                 |  2 +-
 sound/soc/xilinx/xlnx_formatter_pcm.c        |  4 +--
 7 files changed, 25 insertions(+), 16 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/5] ASoC: amd: Fix reference to PCM buffer address
  2021-07-28 11:23 [PATCH 0/5] ASoC: Fix reference to PCM buffer address Takashi Iwai
@ 2021-07-28 11:23 ` Takashi Iwai
  2021-07-30 16:20   ` Mark Brown
  2021-07-30 19:03   ` Mark Brown
  2021-07-28 11:23   ` Takashi Iwai
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, stable

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/amd/acp-pcm-dma.c          | 2 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c  | 2 +-
 sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 143155a840ac..cc1ce6f22caa 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -969,7 +969,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component,
 
 	acp_set_sram_bank_state(rtd->acp_mmio, 0, true);
 	/* Save for runtime private data */
-	rtd->dma_addr = substream->dma_buffer.addr;
+	rtd->dma_addr = runtime->dma_addr;
 	rtd->order = get_order(size);
 
 	/* Fill the page table entries in ACP SRAM */
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 8148b0d22e88..597d7c4b2a6b 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -286,7 +286,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
 		pr_err("pinfo failed\n");
 	}
 	size = params_buffer_bytes(params);
-	rtd->dma_addr = substream->dma_buffer.addr;
+	rtd->dma_addr = substream->runtime->dma_addr;
 	rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
 	config_acp3x_dma(rtd, substream->stream);
 	return 0;
diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index bd20622b0933..11bd22f4fef5 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -242,7 +242,7 @@ static int acp_pdm_dma_hw_params(struct snd_soc_component *component,
 		return -EINVAL;
 	size = params_buffer_bytes(params);
 	period_bytes = params_period_bytes(params);
-	rtd->dma_addr = substream->dma_buffer.addr;
+	rtd->dma_addr = runtime->dma_addr;
 	rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
 	config_acp_dma(rtd, substream->stream);
 	init_pdm_ring_buffer(MEM_WINDOW_START, size, period_bytes,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] ASoC: intel: atom: Fix reference to PCM buffer address
  2021-07-28 11:23 [PATCH 0/5] ASoC: Fix reference to PCM buffer address Takashi Iwai
@ 2021-07-28 11:23   ` Takashi Iwai
  2021-07-28 11:23   ` Takashi Iwai
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Cezary Rojewski, Pierre-Louis Bossart, stable

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 address should be retrieved from runtime->dma_addr,
instead of substream->dma_buffer (and shouldn't use virt_to_phys).

Also, remove the line overriding runtime->dma_area superfluously,
which was already set up at the PCM buffer allocation.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 4124aa2fc247..5db2f4865bbb 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -127,7 +127,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 = virt_to_phys(substream->dma_buffer.area);
+	u32 buffer_addr = substream->runtime->dma_addr;
 
 	channels = substream->runtime->channels;
 	period_size = substream->runtime->period_size;
@@ -233,7 +233,6 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream,
 	/* set codec params and inform SST driver the same */
 	sst_fill_pcm_params(substream, &param);
 	sst_fill_alloc_params(substream, &alloc_params);
-	substream->runtime->dma_area = substream->dma_buffer.area;
 	str_params.sparams = param;
 	str_params.aparams = alloc_params;
 	str_params.codec = SST_CODEC_TYPE_PCM;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] ASoC: intel: atom: Fix reference to PCM buffer address
@ 2021-07-28 11:23   ` Takashi Iwai
  0 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Cezary Rojewski, Mark Brown, Pierre-Louis Bossart, stable

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 address should be retrieved from runtime->dma_addr,
instead of substream->dma_buffer (and shouldn't use virt_to_phys).

Also, remove the line overriding runtime->dma_area superfluously,
which was already set up at the PCM buffer allocation.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 4124aa2fc247..5db2f4865bbb 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -127,7 +127,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 = virt_to_phys(substream->dma_buffer.area);
+	u32 buffer_addr = substream->runtime->dma_addr;
 
 	channels = substream->runtime->channels;
 	period_size = substream->runtime->period_size;
@@ -233,7 +233,6 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream,
 	/* set codec params and inform SST driver the same */
 	sst_fill_pcm_params(substream, &param);
 	sst_fill_alloc_params(substream, &alloc_params);
-	substream->runtime->dma_area = substream->dma_buffer.area;
 	str_params.sparams = param;
 	str_params.aparams = alloc_params;
 	str_params.codec = SST_CODEC_TYPE_PCM;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/5] ASoC: xilinx: Fix reference to PCM buffer address
  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-28 11:23   ` Takashi Iwai
@ 2021-07-28 11:23 ` Takashi Iwai
  2021-07-28 11:23 ` [PATCH 4/5] ASoC: uniphier: " Takashi Iwai
  2021-07-28 11:23 ` [PATCH 5/5] ASoC: kirkwood: " Takashi Iwai
  4 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, stable

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] ASoC: uniphier: Fix reference to PCM buffer address
  2021-07-28 11:23 [PATCH 0/5] ASoC: Fix reference to PCM buffer address Takashi Iwai
                   ` (2 preceding siblings ...)
  2021-07-28 11:23 ` [PATCH 3/5] ASoC: xilinx: " Takashi Iwai
@ 2021-07-28 11:23 ` Takashi Iwai
  2021-07-28 11:23 ` [PATCH 5/5] ASoC: kirkwood: " Takashi Iwai
  4 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, stable

Along with the transition to the managed PCM buffers, the driver now
accepts the dynamically allocated buffer, while it still kept the
reference to the old preallocated buffer address.  This patch corrects
to the right reference via runtime->dma_addr.

(Although this might have been already buggy before the cleanup with
the managed buffer, let's put Fixes tag to point that; it's a corner
case, after all.)

Fixes: d55894bc2763 ("ASoC: uniphier: Use managed buffer allocation")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/uniphier/aio-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/uniphier/aio-dma.c b/sound/soc/uniphier/aio-dma.c
index 3c1628a3a1ac..3d9736e7381f 100644
--- a/sound/soc/uniphier/aio-dma.c
+++ b/sound/soc/uniphier/aio-dma.c
@@ -198,7 +198,7 @@ static int uniphier_aiodma_mmap(struct snd_soc_component *component,
 	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
 
 	return remap_pfn_range(vma, vma->vm_start,
-			       substream->dma_buffer.addr >> PAGE_SHIFT,
+			       substream->runtime->dma_addr >> PAGE_SHIFT,
 			       vma->vm_end - vma->vm_start, vma->vm_page_prot);
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] ASoC: kirkwood: Fix reference to PCM buffer address
  2021-07-28 11:23 [PATCH 0/5] ASoC: Fix reference to PCM buffer address Takashi Iwai
                   ` (3 preceding siblings ...)
  2021-07-28 11:23 ` [PATCH 4/5] ASoC: uniphier: " Takashi Iwai
@ 2021-07-28 11:23 ` Takashi Iwai
  4 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-28 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Lars-Peter Clausen, stable

The transition to the managed PCM buffers allowed the dynamically
buffer allocation, while the driver code still assumes the fixed
preallocation buffer and sets up the DMA stuff at the open call.
This needs to be moved to hw_params after the buffer allocation and
setup.  Also, the reference to the buffer address has to be corrected
to runtime->dma_addr.

Fixes: b3c0ae75f5d3 ("ASoC: kirkwood: Use managed DMA buffer allocation")
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/kirkwood/kirkwood-dma.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
index c2a5933bfcfc..700a18561a94 100644
--- a/sound/soc/kirkwood/kirkwood-dma.c
+++ b/sound/soc/kirkwood/kirkwood-dma.c
@@ -104,8 +104,6 @@ static int kirkwood_dma_open(struct snd_soc_component *component,
 	int err;
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct kirkwood_dma_data *priv = kirkwood_priv(substream);
-	const struct mbus_dram_target_info *dram;
-	unsigned long addr;
 
 	snd_soc_set_runtime_hwparams(substream, &kirkwood_dma_snd_hw);
 
@@ -142,20 +140,14 @@ static int kirkwood_dma_open(struct snd_soc_component *component,
 		writel((unsigned int)-1, priv->io + KIRKWOOD_ERR_MASK);
 	}
 
-	dram = mv_mbus_dram_info();
-	addr = substream->dma_buffer.addr;
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		if (priv->substream_play)
 			return -EBUSY;
 		priv->substream_play = substream;
-		kirkwood_dma_conf_mbus_windows(priv->io,
-			KIRKWOOD_PLAYBACK_WIN, addr, dram);
 	} else {
 		if (priv->substream_rec)
 			return -EBUSY;
 		priv->substream_rec = substream;
-		kirkwood_dma_conf_mbus_windows(priv->io,
-			KIRKWOOD_RECORD_WIN, addr, dram);
 	}
 
 	return 0;
@@ -182,6 +174,23 @@ static int kirkwood_dma_close(struct snd_soc_component *component,
 	return 0;
 }
 
+static int kirkwood_dma_hw_params(struct snd_soc_component *component,
+				  struct snd_pcm_substream *substream,
+				  struct snd_pcm_hw_params *params)
+{
+	struct kirkwood_dma_data *priv = kirkwood_priv(substream);
+	const struct mbus_dram_target_info *dram = mv_mbus_dram_info();
+	unsigned long addr = substream->runtime->dma_addr;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		kirkwood_dma_conf_mbus_windows(priv->io,
+			KIRKWOOD_PLAYBACK_WIN, addr, dram);
+	else
+		kirkwood_dma_conf_mbus_windows(priv->io,
+			KIRKWOOD_RECORD_WIN, addr, dram);
+	return 0;
+}
+
 static int kirkwood_dma_prepare(struct snd_soc_component *component,
 				struct snd_pcm_substream *substream)
 {
@@ -246,6 +255,7 @@ const struct snd_soc_component_driver kirkwood_soc_component = {
 	.name		= DRV_NAME,
 	.open		= kirkwood_dma_open,
 	.close		= kirkwood_dma_close,
+	.hw_params	= kirkwood_dma_hw_params,
 	.prepare	= kirkwood_dma_prepare,
 	.pointer	= kirkwood_dma_pointer,
 	.pcm_construct	= kirkwood_dma_new,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] ASoC: amd: Fix reference to PCM buffer address
  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
  1 sibling, 1 reply; 11+ messages in thread
From: Mark Brown @ 2021-07-30 16:20 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, stable

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

On Wed, Jul 28, 2021 at 01:23:49PM +0200, Takashi Iwai wrote:
> 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.

This breaks the build for me on an x86-64 allmodconfig:

/mnt/kernel/sound/soc/amd/renoir/acp3x-pdm-dma.c: In function 'acp_pdm_dma_hw_params':
/mnt/kernel/sound/soc/amd/renoir/acp3x-pdm-dma.c:245:18: error: 'runtime' undeclared (first use in this function); did you mean 'vtime'?
  rtd->dma_addr = runtime->dma_addr;
                  ^~~~~~~
                  vtime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] ASoC: amd: Fix reference to PCM buffer address
  2021-07-30 16:20   ` Mark Brown
@ 2021-07-30 18:14     ` Takashi Iwai
  0 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2021-07-30 18:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, stable

On Fri, 30 Jul 2021 18:20:25 +0200,
Mark Brown wrote:
> 
> On Wed, Jul 28, 2021 at 01:23:49PM +0200, Takashi Iwai wrote:
> > 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.
> 
> This breaks the build for me on an x86-64 allmodconfig:
> 
> /mnt/kernel/sound/soc/amd/renoir/acp3x-pdm-dma.c: In function 'acp_pdm_dma_hw_params':
> /mnt/kernel/sound/soc/amd/renoir/acp3x-pdm-dma.c:245:18: error: 'runtime' undeclared (first use in this function); did you mean 'vtime'?
>   rtd->dma_addr = runtime->dma_addr;
>                   ^~~~~~~
>                   vtime

Oops, will resubmit the fixed patch set.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] ASoC: amd: Fix reference to PCM buffer address
  2021-07-28 11:23 ` [PATCH 1/5] ASoC: amd: " Takashi Iwai
  2021-07-30 16:20   ` Mark Brown
@ 2021-07-30 19:03   ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2021-07-30 19:03 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel; +Cc: Mark Brown, stable

On Wed, 28 Jul 2021 13:23:49 +0200, Takashi Iwai wrote:
> 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: amd: Fix reference to PCM buffer address
      (no commit info)
[2/5] ASoC: intel: atom: Fix reference to PCM buffer address
      commit: 2e6b836312a477d647a7920b56810a5a25f6c856
[3/5] ASoC: xilinx: Fix reference to PCM buffer address
      commit: 42bc62c9f1d3d4880bdc27acb5ab4784209bb0b0
[4/5] ASoC: uniphier: Fix reference to PCM buffer address
      commit: 827f3164aaa579eee6fd50c6654861d54f282a11
[5/5] ASoC: kirkwood: Fix reference to PCM buffer address
      commit: bb6a40fc5a830cae45ddd5cd6cfa151b008522ed

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/5] ASoC: intel: atom: Fix reference to PCM buffer address
  2021-07-28 11:23   ` Takashi Iwai
  (?)
@ 2021-08-02  8:14   ` Cezary Rojewski
  -1 siblings, 0 replies; 11+ messages in thread
From: Cezary Rojewski @ 2021-08-02  8:14 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel; +Cc: Mark Brown, Pierre-Louis Bossart, stable

On 2021-07-28 1:23 PM, Takashi Iwai wrote:
> 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 address should be retrieved from runtime->dma_addr,
> instead of substream->dma_buffer (and shouldn't use virt_to_phys).
> 
> Also, remove the line overriding runtime->dma_area superfluously,
> which was already set up at the PCM buffer allocation.
> 
> Cc: Cezary Rojewski <cezary.rojewski@intel.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>   sound/soc/intel/atom/sst-mfld-platform-pcm.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> index 4124aa2fc247..5db2f4865bbb 100644
> --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> @@ -127,7 +127,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 = virt_to_phys(substream->dma_buffer.area);
> +	u32 buffer_addr = substream->runtime->dma_addr;
>   
>   	channels = substream->runtime->channels;
>   	period_size = substream->runtime->period_size;
> @@ -233,7 +233,6 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream,
>   	/* set codec params and inform SST driver the same */
>   	sst_fill_pcm_params(substream, &param);
>   	sst_fill_alloc_params(substream, &alloc_params);
> -	substream->runtime->dma_area = substream->dma_buffer.area;
>   	str_params.sparams = param;
>   	str_params.aparams = alloc_params;
>   	str_params.codec = SST_CODEC_TYPE_PCM;
> 

Hello,

Changes look good. Can't verify these due to lack of test vehicles, 
unfortunately.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-02  8:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 3/5] ASoC: xilinx: " Takashi Iwai
2021-07-28 11:23 ` [PATCH 4/5] ASoC: uniphier: " Takashi Iwai
2021-07-28 11:23 ` [PATCH 5/5] ASoC: kirkwood: " Takashi Iwai

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.