From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387544; b=J15hwlrQTrmLt+oFkRlkyLGUHnsX+XeQNbFx2pwhI3HCEE0LatRR0iIj9Lsz1pjJlJDL uWqHKkBoAaf2hkMMlkzXdv59Aov9/AD3Gd/vrrueBokI2ZGh84pOKMVYf4JPJK6sk0xy9 gjLM/J49/6LCwfVMCaSQWbJ4UY8ZX0A7B8tY7bKWjdxHUATuywzC50dWijGW++ZKfhOwR CoUxS/+rE3qOQy0JjG7SR6P/+Vnf9qi2cpmVdh9EfKTStplVRC+D4RG4qvHAu4u4CLnul A0mIVe1khT0G3isTmDhQnufavveJY/G/VprBp8ZCsREUViTDxkacy/vE1v0f8mO2eqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387544; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=7nYAGokvNy4w1IN2J50dh3ZZuh4/DcxuInPQpQDQwuA=; b=q5OwdGrqniGDh69L8nqLOdmj7o6Vps1VI6bDyJJG6bzn1kdH7Y1EABhdLJsVb9ZiHpjb IdCGTM+IcY7DFH/0AySZZvt9s9s2ArIz6pqQ0Ud4GdyezZladWwgXlwgwIlVJ9oOuvucR ODu3v6AGTKxaZoYEVdqC15GaI7pBobBgSEjqoM/Lu2C+BqxMlom3M2BnhYnZAIp3sexl6 dk9r8/1o4X9qNG3zaqdTEQtHLutpSRp1ygd4udjwaIKmNdkrIU6L/sA/EBoJ6P9RIdtwc ZdVUhVaLupF9GWDjpcQaYTWahl58NMRur2yGBxyItlBLQvxqJsVAdwVaRlOp/A1kXnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lneHdIAX; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DCF5606A330 for ; Fri, 4 Dec 2026 12:32:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lneHdIAX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C16F1F000CE; Fri, 4 Dec 2026 12:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796387543; bh=7nYAGokvNy4w1IN2J50dh3ZZuh4/DcxuInPQpQDQwuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lneHdIAXxw+HP75b+g3ShJCPxamUfiAOaAolxvIhTT3ivOegTqe4XmKVYde3n+8R4 KVEASy6JXAS7hHQsht6fVtcgOYyJRYWrVynaaZ4Rv0VL9YKPgn7GXdd+yXc1pEUK0Y L7AhazKsXOqHoHTp+cfXfP/QE/vjWc2z5mpVSLrlNKncmd8DpNxT2Xr/pMbiqtBA/a 4R7/lNWUlae6c7bZLgh/sUNS1wnBadCsQF1Vi8SYjiPCt8EZICzrTEXVs3ba5dnXQ1 Pv3dLBo+7fXAzQeyKLcLMKc7Mt9LUeDLNuKfNJWoaYBClZglNBApkdmjj6YrvMQz0V iFJJy6xYzuutw== From: Sasha Levin To: stable@vger.kernel.org Cc: "Nicholas E. Andrade" , Mark Brown , Sasha Levin 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 Message-ID: <20261204123157.3019848-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120240-vanquish-ankle-9f08@gregkh> References: <2026120240-vanquish-ankle-9f08@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Nicholas E. Andrade" [ 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 Link: https://patch.msgid.link/20261109-for-next-v1-1-54a06f391bda@gmail.com Signed-off-by: Mark Brown [ 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 --- 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