ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821
ASoC: SOF: Intel: hda: skip unattached peripherals in default machine#5821ger5ones wants to merge 1 commit into
Conversation
When no SoundWire machine driver matches the ACPI-reported configuration, hda_sdw_machine_select() builds a default machine from the enumerated SoundWire peripherals. The link mask and the per-peripheral adr_d entries are generated by iterating over every entry in hdev->sdw->peripherals, including peripherals that never attached to the bus. Some platforms declare SoundWire peripherals in ACPI that are not physically populated. On the ASUS Zenbook S14 UX5406AA (PCI SSID 1043:1464) the BIOS declares an RT722 (025d:0722) on link 3 that stays SDW_SLAVE_UNATTACHED, alongside the physically present CS42L43. The phantom peripheral adds a second SimpleJack function on the same link, whose DAI name collides with the CS42L43 one: kobject_add_internal failed for SDW3-Playback-SimpleJack with -EEXIST sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12 so card registration fails and only HDMI/Loopback remain. Skip peripherals whose status is SDW_SLAVE_UNATTACHED when computing the link mask and when generating the adr_d entries, so the default machine reflects only hardware that is actually present, and bail out if no peripheral is attached. Signed-off-by: Gerson Tamanaha Yabiku <gerson.yabiku@gmail.com>
|
Can one of the admins verify this patch?
|
There was a problem hiding this comment.
Pull request overview
This PR updates the SOF Intel HDA SoundWire default-machine construction so that only peripherals that have actually attached to the SoundWire bus are considered, avoiding phantom ACPI-declared devices that can cause DAI name collisions and card registration failures.
Changes:
- Skip
SDW_SLAVE_UNATTACHEDperipherals when computing the default-machinelink_mask. - Skip
SDW_SLAVE_UNATTACHEDperipherals when generating per-link_ADRdevice (adr_d) entries. - Bail out of default-machine creation when no peripherals are attached.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!link_mask) | ||
| return NULL; |
bardliao
left a comment
There was a problem hiding this comment.
That the peripherals may attach after the default mach is generated.
Besides, the peripherals will not be always attached. You at least should check slave->dev_num_sticky instead of peripherals->array[i]->status and need to wait for sometime to ensure the peripheral will never be attached. Please see my PRttps://github.com//pull/5741.
#5773 is probably the best way to fix the issue.
|
This laptop should already be supported, if you pull in the patches from this branch: https://github.com/charleskeepax/linux/commits/v7.0-cs42l43/ |
When no SoundWire machine driver matches the ACPI-reported configuration, hda_sdw_machine_select() builds a default machine from the enumerated SoundWire peripherals. The link mask and the per-peripheral adr_d entries are generated by iterating over every entry in hdev->sdw->peripherals, including peripherals that never attached to the bus.
Some platforms declare SoundWire peripherals in ACPI that are not physically populated. On the ASUS Zenbook S14 UX5406AA (PCI SSID 1043:1464) the BIOS declares an RT722 (025d:0722) on link 3 that stays SDW_SLAVE_UNATTACHED, alongside the physically present CS42L43. The phantom peripheral adds a second SimpleJack function on the same link, whose DAI name collides with the CS42L43 one:
kobject_add_internal failed for SDW3-Playback-SimpleJack with -EEXIST
sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12
so card registration fails and only HDMI/Loopback remain.
Skip peripherals whose status is SDW_SLAVE_UNATTACHED when computing the link mask and when generating the adr_d entries, so the default machine reflects only hardware that is actually present, and bail out if no peripheral is attached.
Testing
Tested on ASUS Zenbook S14 UX5406AA (Panther Lake, PCI SSID 1043:1464,
CS42L43 + 4x CS35L56 over SoundWire). Without this patch, card
registration fails with -EEXIST / -12 because a phantom RT722
(025d:0722) declared in ACPI on link 3 never attaches and collides the
SDW3-Playback-SimpleJack DAI with the CS42L43. With the patch the
sof-soundwire card registers, the Speaker PCM appears, and all four
CS35L56 amplifiers attach and load their 10431464 firmware/calibration.
Note: a separate channel-routing limitation (the default machine selects
sof-sdca-2amp for a 4-amp board, leaving one side silent) is independent
of this fix and will be addressed separately.