From: Sergey Lebedev <lsa.uz@pm.me>
To: Bard Liao <bard.liao@intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Vinod Koul <vkoul@kernel.org>, 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>,
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 2/3] ASoC: sdw_utils: skip endpoints of a peripheral that is not on the bus
Date: Sun, 30 Aug 2026 08:44:58 +0000 [thread overview]
Message-ID: <20260830084446.6092-1-lsa.uz@pm.me> (raw)
In-Reply-To: <SJ2PR11MB8424F459A22A44CAFA9C9EBBFFD32@SJ2PR11MB8424.namprd11.prod.outlook.com>
Sorry for the long silence - I did not have access to the hardware until
now. Thank you both for the review; it changed the shape of the fix for
the better.
> > Why not just remove SWRA from the BIOS?
>
> Or add a quirk in drivers/soundwire/dmi-quirks.c to skip this SWRA
> device entirely, this has been the direction so far to ignore 'ghost'
> devices.
>
> It's much safer IMHO than trying to detect if a device is physically
> present or not.
Agreed, and it works. I have tested it on the machine and it is good
enough: one quirk replaces both 2/3 and 3/3, so v2 is two patches
instead of three, and nothing has to guess at runtime whether a device
is present.
With the ghost's _ADR remapped to zero, sdw_acpi_find_slaves() never
creates the peripheral:
# ls /sys/bus/soundwire/devices/
sdw-master-0-0
sdw:0:0:025d:1320:01 <- only the real one now
and everything downstream falls out:
- amplifier is named "rt1320-1", so the stock sof-soundwire UCM
profile addresses the device that is actually there
- no -EEXIST, no -61 link startup errors, card registers cleanly
- 4 playback + 1 capture, speakers audible, internal mic captures
- no local UCM, PipeWire or WirePlumber configuration
On the BIOS question: the firmware is Microsoft's, signed, and updated
through Windows Update. The defect is present in the current November
2025 bundle and on every unit shipped so far, so I have no way to have
SWRA removed at the source.
> Not sure if it is the case, but it is possible that the SKU has
> different rt1320 versions depending on when was the device
> manufactured. Hope they use different SKU values with different
> rt1320 versions.
Good point, and it is a real hazard: the remap keys on the full 64-bit
_ADR, whose version nibble is part of the match. A batch with a
different RT1320 version would not match - harmless - but if such a
batch ever reported class 0 as the real part, a name-keyed quirk would
remove the working device and leave the ghost.
v2 therefore matches on the product SKU rather than the product name,
following dell_sku_0A3E above it:
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU,
"Surface_Pro_11th_Edition_With_Intel_For_Business_2103")
That keeps the remap to the hardware it was verified on. If other SKUs
turn out to need it, they can be added as they are reported, which is
also how we would find out whether the versions do differ.
On the other review point, for completeness:
> Not sure if it is true. AFAIK, Realtek has a few codecs with the same
> part ID and different class ID and they are different codecs.
Understood - and it no longer matters, because the patch that assumed
otherwise is dropped in v2. The quirk claims nothing general about class
ids; it says only that on this SKU this specific _ADR is a ghost, which
is the one thing I have actually verified.
One correction I owe you, because I told you the opposite in the v1
cover letter. About the DAI link name collision I had written a fourth
patch for and then dropped, I said:
"With 2/3 applied the phantom's endpoints never reach the naming code,
so that collision is no longer reachable on this machine and we
cannot demonstrate it."
That was wrong. While testing v2 I had a boot where the quirk did not
take effect, and the machine failed exactly there:
sysfs: cannot create duplicate filename
'/devices/pci0000:00/0000:00:1f.3/sof_sdw/SDW0-Capture-SmartMic'
kobject_add_internal failed for SDW0-Capture-SmartMic with -EEXIST,
don't try to register things with the same name in the same directory
sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12
So the collision is reachable, reproducible and fatal whenever a ghost
declaring a duplicate function reaches create_sdw_dailink(). The quirk
does not fix that; it only removes this particular ghost before the
naming code sees it. create_sdw_dailink() still builds names from link
id and function type alone, so any board with two peripherals of the
same function type on one link would hit it.
I have not included a fix in v2 - with the quirk applied I cannot
reproduce it on purpose any more, and I would rather not send an
untestable patch. If you would like it addressed, I am happy to send it
separately and to describe the failure in more detail.
Testing note for v2: verified on 7.0.0-30 (Ubuntu 26.04), with the quirk
backported, because that is the kernel this machine runs. The posted
patch is against thesofproject/linux topic/sof-dev; the table entry is
identical and the mechanism it relies on is unchanged between the two
trees - slave.c drops a peripheral whose overridden _ADR is zero in
both. 1/2 is byte-identical to v1's 1/3 and unchanged since it was
tested on 7.1.0-rc7.
v2 follows this message.
Thanks again,
Sergey
next prev parent reply other threads:[~2026-08-30 8:45 UTC|newest]
Thread overview: 15+ 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-30 8:44 ` Sergey Lebedev [this message]
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
2026-08-30 8:45 ` [PATCH v2 0/2] ASoC: fix audio on the Microsoft Surface Pro 11 (Intel) Sergey Lebedev
2026-08-30 8:45 ` [PATCH v2 1/2] ASoC: rt1320: run the initialisation preset on the first hardware init Sergey Lebedev
2026-08-30 8:45 ` [PATCH v2 2/2] soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel) Sergey Lebedev
2026-08-30 12:26 ` [PATCH v2 0/2] ASoC: fix audio on the Microsoft " Sergey Lebedev
2026-08-30 14:27 ` Mark Brown
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=20260830084446.6092-1-lsa.uz@pm.me \
--to=lsa.uz@pm.me \
--cc=Vijendar.Mukunda@amd.com \
--cc=bard.liao@intel.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=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--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
all inboxes | Powered by JetHome®