Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Corey Smith" <corsmith@gmail.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 3/11] ASoC: amd: ps: add ACP6x PCI revision ids
Date: Wed, 28 Oct 2026 02:15:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-187336@kernel.org> (raw)
In-Reply-To: <20261028020552.35278-4-corsmith@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ASoC: amd: ps: ACP6X_REG_END truncates SoundWire DMA scratch PTE range
--

commit ad82886a02e0737dcd97ae5c1b3d4d8287cac193
Author: Corey Smith <corsmith@gmail.com>

ASoC: amd: ps: add ACP6x PCI revision ids

This commit adds ACP6x (Rembrandt) PCI revision IDs, the ACP6x register
range, and the SoundWire controller ACPI address to the Pink Sardine
header so the driver can bind to ACP6x devices.

> diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h
> index d0cfbd4dafc17..b7d2666b27fc7 100644
> --- a/sound/soc/amd/ps/acp63.h
> +++ b/sound/soc/amd/ps/acp63.h
> @@ -9,8 +9,12 @@
>  #include <sound/acp63_chip_offset_byte.h>
>  
>  #define ACP_DEVICE_ID 0x15E2
> +#define ACP6X_REG_START		0x1240000
> +#define ACP6X_REG_END		0x1250200

[Severity: Medium]
Should ACP6X_REG_END be 0x125C000 instead of 0x1250200?

Defining ACP6X_REG_END as 0x1250200 (matching the PDM-only Yellow Carp
header in sound/soc/amd/yc/acp6x.h) sizes the ACP6x register range to
0x10200 bytes. When snd_acp63_probe() sets adata->reg_range to
ACP6X_REG_END - ACP6X_REG_START, create_acp63_platform_devs() creates the
IORESOURCE_MEM resource for amd_ps_sdw_dma with a size of 0x10201 bytes,
which acp63_sdw_platform_probe() maps via devm_ioremap().

However, SoundWire DMA page table entries in ACP scratch memory start past
0x10200:

sound/soc/amd/ps/acp63.h:
    #define SDW0_PTE_OFFSET		0x400
    ...
    #define ACP_SDW_PTE_OFFSET		0x100
    #define SDW_PTE_OFFSET(i)		(SDW0_PTE_OFFSET + ((i) * 0x600))

When acp63_config_dma() in sound/soc/amd/ps/ps-sdw-dma.c programs the
SoundWire DMA PTEs during PCM hw_params or resume, it writes to offsets
0x10400 through 0x10B80 past acp_base (since ACP_SCRATCH_REG_0 is 0x10000):

sound/soc/amd/ps/ps-sdw-dma.c:acp63_config_dma() {
    ...
    sdw_dma_pte_offset = SDW_PTE_OFFSET(stream->instance);
    val = sdw_dma_pte_offset + (stream_id * ACP_SDW_PTE_OFFSET);
    ...
    for (page_idx = 0; page_idx < stream->num_pages; page_idx++) {
        ...
        writel(low, acp_base + ACP_SCRATCH_REG_0 + val);
        high |= BIT(31);
        writel(high, acp_base + ACP_SCRATCH_REG_0 + val + 4);
    ...
}

This accesses MMIO offsets beyond the declared resource and devm_ioremap()
size. Note that commit 253ce07d2a09 ("ASoC: amd: ps: modify ACP register
end address macro") previously updated ACP63_REG_END from 0x1250200 to
0x125C000 for this reason, and sound/soc/sof/amd/pci-rmb.c also defines
ACP6x_REG_END as 0x125C000.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028020552.35278-1-corsmith@gmail.com?part=3

  reply	other threads:[~2026-10-28  2:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  2:05 [PATCH 0/11] ASoC/soundwire: AMD ACP6x (Rembrandt) SoundWire speaker support Corey Smith
2026-10-28  2:05 ` [PATCH 1/11] soundwire: amd: add ACP6x PCI revision ids Corey Smith
2026-10-28  2:05 ` [PATCH 2/11] soundwire: amd: support ACP6x SoundWire managers Corey Smith
2026-10-28  2:05 ` [PATCH 3/11] ASoC: amd: ps: add ACP6x PCI revision ids Corey Smith
2026-10-28  2:15   ` sashiko-bot [this message]
2026-10-28  2:05 ` [PATCH 4/11] ASoC: amd: ps: support ACP6x in the SoundWire DMA driver Corey Smith
2026-10-28  2:05 ` [PATCH 5/11] ASoC: amd: acp: add ACP6x (Rembrandt) SoundWire machine table Corey Smith
2026-10-28  2:05 ` [PATCH 6/11] ASoC: amd: acp-config: route HP Dragonfly Pro ONE through the ACP6x SDW stack Corey Smith
2026-10-28  2:05 ` [PATCH 7/11] ASoC: amd: ps: probe the ACP6x SoundWire stack Corey Smith
2026-10-28  2:20   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 8/11] ASoC: amd: acp: add ACP6x SoundWire quirks and machine support Corey Smith
2026-10-28  2:22   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 9/11] soundwire: amd: accept the legacy mipi-sdw-master-list property Corey Smith
2026-10-28  2:05 ` [PATCH 10/11] ASoC: amd: ps: harden the ACP interrupt path for ACP6x Corey Smith
2026-10-28  2:21   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 11/11] soundwire: amd: provide defaults for the bus clock properties Corey Smith
2026-10-29  6:58 ` [PATCH 0/11] ASoC/soundwire: AMD ACP6x (Rembrandt) SoundWire speaker support Mukunda,Vijendar

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=sashiko-outbox-187336@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=corsmith@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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