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=1796382307; b=Ry3WR5114QQga1nDNkgnG/sC28AOCvODSzpLlCxOb7EvqUV0yGTHJrsijiQROXqZRw9z rU0VNi0VrNcx7PQobiLpA7QPvEf2krXWaPv/It4utZ6/Y90yv+FbY83klgsEMbob+BwC4 LdDZPvRVW6xEVGpUdadb5m0roeBCfTzvFEZJV9bQzhrbXk1dU327/xCj+spKplN+7o1pF lxfCp2519g7QWyoRWYPnEC9+VMvXb7/VbYC4sojAZJBowynF0uewcDSb+C82I++kLSODQ Hc7+D9rP9+9n3MPCWBtyOCuHb1aw4zpqNgrVDVNSx6CsZIIzctpxMA3Wzny4aJsW+Hg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382307; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=nd3ViSAGLkvugQXOWv0mXHQHtzYqUYLsIVnRXbnExpk=; b=ndJKGsfagaduSkAM9wN3FwZOg3ynYfvaU1a+1w8wMkjM/HssJPJdc1iGYpyhkj3PQu1e U97NmHOGSbniNC8chz/M24G55tpVBLFiV4y16Z0zjtVmAglqfiW7ReoNQhJ+5jEaxyb36 DQ5/5LESMw57MMv1hUEUZb4f542AT8I2VIvsMxY6e1qT53YHF5/P308J3NPwV+poxOlO3 QF01bohzUs4ciNyQ6RojDIVjiP7JrR4Tjo1Tz/HBRwsg51V8+liMY7pR9RvjX/pA+8vDz vy72VPbKigs7nMloTjlPeIkP3Ic9P6mcrqGieTxdeGKCotUOdZs/ulbgUfIqBTsQZ2w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fWL0WtDM; 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 0838F606A33C; Fri, 4 Dec 2026 11:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fWL0WtDM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 322D91F00A02; Fri, 4 Dec 2026 11:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382306; bh=nd3ViSAGLkvugQXOWv0mXHQHtzYqUYLsIVnRXbnExpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fWL0WtDM21H/Oi7Pvb2mLCQUIl4dSWU6tUVTZCPAjxOzGUCN6jviat21GVFOk58Aq oSuELc7DY7fGjdK2O5PemlKmdWj4x29mLxMUSoXzFk8+3KTtKLCjyEe7YnxZehj/ZU lm6wqApI2+mrkG6Npub6O0lZXQ9nQOu5MiJhbjjA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Nicholas E. Andrade" , Mark Brown Subject: [PATCH 6.18 396/703] ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume Date: Fri, 4 Dec 2026 19:04:55 +0900 Message-ID: <20261204100638.366045074@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas E. Andrade commit a3d8527ed469a31aeeb02c5e52ed89de410e46e6 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- sound/soc/amd/acp/acp-legacy-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- 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(stru 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);