From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Nicholas E. Andrade" <sdnick484@gmail.com>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y] ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume
Date: Fri, 4 Dec 2026 07:32:22 -0500 [thread overview]
Message-ID: <20261204123157.3019848-1-sashal@kernel.org> (raw)
In-Reply-To: <2026120240-vanquish-ankle-9f08@gregkh>
From: "Nicholas E. Andrade" <sdnick484@gmail.com>
[ Upstream commit a3d8527ed469a31aeeb02c5e52ed89de410e46e6 ]
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>
Link: https://patch.msgid.link/20261109-for-next-v1-1-54a06f391bda@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Added a local chip = dev_get_platdata(dev) in set_acp_pdm_ring_buffer() and replaced ACP70_PCI_ID with this tree's ACP70_DEV, since neither exists in the older code. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp/acp-legacy-common.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c
index e4af2640feeb1..5a6cbe50e462d 100644
--- a/sound/soc/amd/acp/acp-legacy-common.c
+++ b/sound/soc/amd/acp/acp-legacy-common.c
@@ -50,12 +50,16 @@ static void set_acp_pdm_ring_buffer(struct snd_pcm_substream *substream,
struct acp_stream *stream = runtime->private_data;
struct device *dev = dai->component->dev;
struct acp_dev_data *adata = dev_get_drvdata(dev);
+ struct acp_chip_info *chip = dev_get_platdata(dev);
u32 physical_addr, pdm_size, period_bytes;
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_DEV)
+ physical_addr = ACP7x_DMIC_MEM_WINDOW_START;
+ else
+ physical_addr = stream->reg_offset + MEM_WINDOW_START;
/* Init ACP PDM Ring buffer */
writel(physical_addr, adata->acp_base + ACP_WOV_RX_RINGBUFADDR);
--
2.53.0
prev parent reply other threads:[~2026-12-04 12:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 15:40 FAILED: patch "[PATCH] ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume" failed to apply to 6.12-stable tree gregkh
2026-12-04 12:32 ` Sasha Levin [this message]
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=20261204123157.3019848-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=sdnick484@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox