From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Sergey Lebedev <lsa.uz@pm.me>, Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Oder Chiou <oder_chiou@realtek.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: linux-sound@vger.kernel.org,
sound-open-firmware@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] ASoC: SOF: Intel: hda: duplicate _ADR entries share one amp index
Date: Wed, 5 Aug 2026 10:33:34 +0200 [thread overview]
Message-ID: <467504ea-c111-4149-9d37-62d55b2b83a9@linux.dev> (raw)
In-Reply-To: <20260804225853.31585-4-lsa.uz@pm.me>
On 8/5/26 00:59, Sergey Lebedev wrote:
> find_acpi_adr_device() assigns each amplifier a name prefix carrying an
> index ("rt1320-1", "rt1320-2", or Left/Right) and advances that index
> once per _ADR entry. Firmware that describes one physical part with two
> _ADR entries therefore consumes two indices for one device.
>
> The Microsoft Surface Pro 11 (Intel) does exactly that. Link 0 carries:
>
> SWRA _ADR 0x000030025D132000 SDCA class 0
> SWRB _ADR 0x000030025D132001 SDCA class 1
>
> identical but for the class id: same link, same manufacturer, part and
> version, same unique id 0. The part reports class 1, so SWRB is the one
> that enumerates and SWRA never attaches on any boot or firmware version
> tested.
>
> Both still reach this function, so SWRA takes index 1 and the real
> amplifier is named "rt1320-2". Its controls appear as "rt1320-2 OT23 L/R
> Switch". The stock sof-soundwire UCM profile expects the first
> amplifier, so it enables switches on a device that is not present, and
> the speakers stay silent while everything else reports success.
>
> Compare entries that differ only in class id and give the later one the
> earlier one's name prefix, jumping past the amplifier-index increment so
> a repeated description consumes one index rather than several.
>
> Testing the peripheral's attach status instead does not work here, and
> was tried: at machine-select time neither entry has attached yet, so a
> status test finds both unattached, no amplifier is matched at all, and
> the card falls back to the HDMI-only HDA machine driver. Comparing
> addresses needs no runtime state.
yeah but that means two methods to detect the presence of this ghost
device...
>
> Signed-off-by: Sergey Lebedev <lsa.uz@pm.me>
> ---
> sound/soc/sof/intel/hda.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index 4dbba9186..1d60a8caa 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -1245,6 +1245,22 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
> ((u64)(sdw_device->id.sdw_version & 0xF) << 44) |
> ((u64)(sdw_device->bus->link_id & 0xF) << 48);
>
> + /*
> + * Firmware may describe a single physical part with more than one _ADR
> + * entry, differing only in SDCA class id. Those entries are the same
> + * device: they must share a name prefix, and only the first of them may
> + * consume an amp index. Otherwise the part that actually enumerates is
> + * named as though it were the second amplifier, and UCM profiles
> + * written for the first one address a device that is not there.
> + */
> + for (j = 0; j < index; j++) {
> + if ((adr_dev[j].adr & ~SDW_CLASS_ID_MASK) ==
> + (adr_dev[index].adr & ~SDW_CLASS_ID_MASK)) {
> + adr_dev[index].name_prefix = adr_dev[j].name_prefix;
> + goto done_name_prefix;
> + }
> + }
> +
The DMI quirk removes the need for the two patches that detect the
presence of the ghost device through two different mechanisms.
Can you try with a DMI quirk and let us know if this is good enough?
prev parent reply other threads:[~2026-08-05 8:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 22:59 [PATCH 0/3] ASoC: fix audio on the Microsoft Surface Pro 11 (Intel) Sergey Lebedev
2026-08-04 22:59 ` [PATCH 1/3] ASoC: rt1320: run the initialisation preset on the first hardware init Sergey Lebedev
2026-08-04 22:59 ` [PATCH 2/3] ASoC: sdw_utils: skip endpoints of a peripheral that is not on the bus Sergey Lebedev
2026-08-05 1:12 ` Liao, Bard
2026-08-05 8:22 ` Pierre-Louis Bossart
2026-08-05 13:28 ` Liao, Bard
2026-08-04 22:59 ` [PATCH 3/3] ASoC: SOF: Intel: hda: duplicate _ADR entries share one amp index Sergey Lebedev
2026-08-05 1:21 ` Liao, Bard
2026-08-05 8:33 ` Pierre-Louis Bossart [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=467504ea-c111-4149-9d37-62d55b2b83a9@linux.dev \
--to=pierre-louis.bossart@linux.dev \
--cc=Vijendar.Mukunda@amd.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lsa.uz@pm.me \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/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