mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume
@ 2026-11-09 18:22 Nicholas E. Andrade via B4 Relay
  0 siblings, 0 replies; only message in thread
From: Nicholas E. Andrade via B4 Relay @ 2026-11-09 18:22 UTC (permalink / raw)
  To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, linux-kernel, stable, Nicholas E. Andrade

From: "Nicholas E. Andrade" <sdnick484@gmail.com>

On ACP7.x the DMIC ring buffer lives at ACP7x_DMIC_MEM_WINDOW_START,
and acp_dmic_prepare() programs ACP_WOV_RX_RINGBUFADDR accordingly.
The system resume path (acp70_pcm_resume() -> restore_acp_pdm_params()
-> set_acp_pdm_ring_buffer()) however still uses the pre-ACP7.x
calculation, stream->reg_offset + MEM_WINDOW_START (0x6080000).

That window is not backed by the PTEs config_acp_dma() writes for the
DMIC stream (scratch offset 0x6000, i.e. window 0x4C00000), so after
resume the ATU translates DMIC DMA through uninitialised SRAM and the
ACP writes to random IOVAs. With the IOMMU enabled, a capture stream
held open across s2idle produces a continuous stream of faults until
it is closed, and captures nothing useful:

  snd_acp_pci 0000:c4:00.5: AMD-Vi: Event logged [IO_PAGE_FAULT
  domain=0x0018 address=0x1ddeee9942398e20 flags=0x0030]

Commit 3ee257aba1d5 ("ASoC: amd: acp: Audio is not resuming after
s0ix") fixed the same problem for the I2S restore path in
set_acp_i2s_dma_fifo() but left the PDM path unchanged. Select the
ACP7.x window there too, matching acp_dmic_prepare().

Tested on a Lenovo ThinkPad P14s Gen 6 AMD (ACP rev 0x71, kernel
7.3.1) by holding
  arecord -D hw:CARD=acppdmmach,DEV=0 -f S32_LE -r 48000 -c 2
open across s2idle: before the fix, IO_PAGE_FAULTs after every resume
and no audio; after, no faults and audio captured correctly after
resume.

The bug was diagnosed and the fix drafted with the help of an AI
coding assistant (Claude); the analysis, change and testing were
reviewed and verified by the submitter on the hardware above.

Fixes: f6f7d25b1103 ("ASoC: amd: acp: Add pte configuration for ACP7.0 platform")
Cc: stable@vger.kernel.org

Signed-off-by: Nicholas E. Andrade <sdnick484@gmail.com>
---
 sound/soc/amd/acp/acp-legacy-common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c
index 4e477c48d4b..9c0528a7dfc 100644
--- a/sound/soc/amd/acp/acp-legacy-common.c
+++ b/sound/soc/amd/acp/acp-legacy-common.c
@@ -154,7 +154,10 @@ static void set_acp_pdm_ring_buffer(struct snd_pcm_substream *substream,
 
 	period_bytes = frames_to_bytes(runtime, runtime->period_size);
 	pdm_size = frames_to_bytes(runtime, runtime->buffer_size);
-	physical_addr = stream->reg_offset + MEM_WINDOW_START;
+	if (chip->acp_rev >= ACP70_PCI_ID)
+		physical_addr = ACP7x_DMIC_MEM_WINDOW_START;
+	else
+		physical_addr = stream->reg_offset + MEM_WINDOW_START;
 
 	/* Init ACP PDM Ring buffer */
 	writel(physical_addr, chip->base + ACP_WOV_RX_RINGBUFADDR);

---
base-commit: cde5523c75f1320a55ac1d55a717ccbb566557f0
change-id: 20261109-for-next-a23a02ba9b6b

Best regards,
--  
Nicholas E. Andrade <sdnick484@gmail.com>



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-09 18:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 18:22 [PATCH] ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume Nicholas E. Andrade via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®