]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SDCA: Fix cleanup inversion in class driver
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 9 Apr 2026 16:43:26 +0000 (17:43 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2026 18:39:30 +0000 (19:39 +0100)
commit7936490e04733ade80d0d445529c0a6de0f95515
treef2f5fea8d162210a6cb38cb09e7fff4bdd7dcc8b
parentc271b0815f45078342bc4e778683c86fdc45fde7
ASoC: SDCA: Fix cleanup inversion in class driver

Fix inverted cleanup of the SoundWire IRQ and the function drivers
that use it.

The devm cleanup function to call sdca_dev_unregister_functions() was
being registered at the end of class_sdw_probe(). The bus core
creates the parent SoundWire IRQ handler after class_sdw_probe() has
returned, and it registers a devm cleanup handler at the same time.

This led to a cleanup inversion where the devm cleanup for the parent
Soundwire IRQ runs before the handler that removes the function drivers.
So the parent IRQ is destroyed before the function drivers had a chance
to do any cleanup and remove their IRQ handlers.

Move the registrations of the function driver cleanup into
class_boot_work() after the function drivers are registered, so that it
runs before the cleanup of the parent SoundWire IRQ handler.

Fixes: 2d877d0659cb ("ASoC: SDCA: Add basic SDCA class driver")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260409164328.3999434-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_class.c