]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: soc-core: Don't fail if device_link could not be created
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 23 Jun 2026 13:58:21 +0000 (14:58 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 24 Jun 2026 12:01:38 +0000 (13:01 +0100)
commita7ea04d1ad39d60da397de75b503062ad5fa562b
tree9a200fb35f500e86a15164c4a9a3799b9f192bdf
parent83d53eca7e5512b53ecef6cf67ea8cbfb595516e
ASoC: soc-core: Don't fail if device_link could not be created

If device_link_add() fails in snd_soc_bind_card() just skip that
driver pair and carry on.

This means that ASoC must now keep track of which components it was
able to device_link to the card->dev. The new card_device_link member
of struct snd_soc_component is non-NULL if a device_link exists.

The intent of the device link is to ensure that the machine driver
system-suspends before the component drivers, to prevent ASoC
suspend attempting to reconfigure a driver that has already suspended.

It isn't possible to create this device link if the machine driver is
a parent of the component driver or already has a device_link in the
opposite direction. In this case skip the link. A warn is placed in
kernel log since this might indicate a genuine design problem with
those two drivers (this can be downgraded to dbg in future when
people are happy that all these special drivers correctly handle their
reversed shutdown order).

Fixes: 0f54ce994b23 ("ASoC: soc-core: Create device_link to ensure correct suspend order")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/linux-sound/61bd38e7-5eb9-4448-a93f-afa2ccbd1c9d@opensource.cirrus.com/T/#m496fe5a11b0a3649afd2e85da5e1cea82bb16d8a
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260623135821.4125543-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-component.h
sound/soc/soc-core.c