Skip to content

Commit 7d520fb

Browse files
committed
ASoC: SOF: Intel: avoid partial SDW machine matches on ACE 2.0+
On ACE 2.0+ platforms, if no predefined SoundWire machine matches, the driver can build a default SDW machine description and select function topologies from the ACPI-reported peripherals. Keep the existing subset-based matching for pre-ACE 2.0 platforms, but avoid selecting a partially matched machine on ACE 2.0+ systems. A partial match may pick a subset topology, which can leave some endpoints unavailable or break audio completely. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent ec166f4 commit 7d520fb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,8 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
13371337
return NULL;
13381338
}
13391339

1340+
chip = get_chip_info(sdev->pdata);
1341+
13401342
/*
13411343
* Select SoundWire machine driver if needed using the
13421344
* alternate tables. This case deals with SoundWire-only
@@ -1352,8 +1354,13 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
13521354
* first check whether link_mask of mach is subset of
13531355
* link_mask supported by hw and then go on searching
13541356
* link_adr
1357+
* For those platforms that can use the created SDW mach below,
1358+
* match the two masks exactly to avoid using an unexpected
1359+
* mach.
13551360
*/
1356-
if (~hdev->info.link_mask & mach->link_mask)
1361+
if (~hdev->info.link_mask & mach->link_mask ||
1362+
(hdev->info.link_mask != mach->link_mask &&
1363+
chip->hw_ip_version >= SOF_INTEL_ACE_2_0))
13571364
continue;
13581365

13591366
/* No need to match adr if there is no links defined */
@@ -1393,8 +1400,6 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
13931400
peripherals->array[i]->id.part_id,
13941401
peripherals->array[i]->id.sdw_version);
13951402

1396-
chip = get_chip_info(sdev->pdata);
1397-
13981403
/* SDCA was not well supported in the BIOS before ACE2.0 */
13991404
if (chip->hw_ip_version < SOF_INTEL_ACE_2_0)
14001405
return NULL;

0 commit comments

Comments
 (0)