* [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup
@ 2026-05-05 16:11 Richard Fitzgerald
2026-05-05 16:11 ` [PATCH v2 1/2] ASoC: cs35l56: Don't use devres to unregister component Richard Fitzgerald
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Richard Fitzgerald @ 2026-05-05 16:11 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches
Two patches to fix cleanup during driver remove() and the error path
of probe().
The main purpose is to fix cleanup of the workqueue.
Richard Fitzgerald (2):
ASoC: cs35l56: Don't use devres to unregister component
ASoC: cs35l56: Destroy workqueue in probe error path
sound/soc/codecs/cs35l56.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 1/2] ASoC: cs35l56: Don't use devres to unregister component 2026-05-05 16:11 [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Richard Fitzgerald @ 2026-05-05 16:11 ` Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 2/2] ASoC: cs35l56: Destroy workqueue in probe error path Richard Fitzgerald 2026-05-06 12:22 ` [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Mark Brown 2 siblings, 0 replies; 4+ messages in thread From: Richard Fitzgerald @ 2026-05-05 16:11 UTC (permalink / raw) To: broonie; +Cc: linux-sound, linux-kernel, patches Manually call snd_soc_unregister_component() from cs35l56_remove() instead of using devres cleanup. This ensures that the component is destroyed before cs35l56_remove() starts cleanup of anything the component code could be using. Devres cleanup happens after the driver remove() callback, so if snd_soc_register_component() is used, it will not be destroyed until after cs35l56_remove() has returned. But there is some cleanup that must be done in cs35l56_remove(), or wrapped in a custom devres cleanup handler to ensure correct ordering. The simplest option is to call snd_soc_unregister_component() at the start of cs35l56_remove(). Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56") Closes: https://sashiko.dev/#/patchset/20260501103002.2843735-1-rf%40opensource.cirrus.com Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> --- New in V2 series. sound/soc/codecs/cs35l56.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index 378017fcea10..e847bb32af2e 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -1956,9 +1956,9 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56) goto err; } - ret = devm_snd_soc_register_component(cs35l56->base.dev, - &soc_component_dev_cs35l56, - cs35l56_dai, ARRAY_SIZE(cs35l56_dai)); + ret = snd_soc_register_component(cs35l56->base.dev, + &soc_component_dev_cs35l56, + cs35l56_dai, ARRAY_SIZE(cs35l56_dai)); if (ret < 0) { dev_err_probe(cs35l56->base.dev, ret, "Register codec failed\n"); goto err; @@ -2057,6 +2057,8 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_init, "SND_SOC_CS35L56_CORE"); void cs35l56_remove(struct cs35l56_private *cs35l56) { + snd_soc_unregister_component(cs35l56->base.dev); + cs35l56->base.init_done = false; /* -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] ASoC: cs35l56: Destroy workqueue in probe error path 2026-05-05 16:11 [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 1/2] ASoC: cs35l56: Don't use devres to unregister component Richard Fitzgerald @ 2026-05-05 16:11 ` Richard Fitzgerald 2026-05-06 12:22 ` [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Mark Brown 2 siblings, 0 replies; 4+ messages in thread From: Richard Fitzgerald @ 2026-05-05 16:11 UTC (permalink / raw) To: broonie; +Cc: linux-sound, linux-kernel, patches The error path in cs35l56_common_probe() should call destroy_workqueue() on the workqueue that was created by cs35l56_dsp_init(). Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56") Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> --- No changes from V1 sound/soc/codecs/cs35l56.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index e847bb32af2e..849d70ca23d6 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -1970,6 +1970,9 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56) gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 0); regulator_bulk_disable(ARRAY_SIZE(cs35l56->supplies), cs35l56->supplies); + if (cs35l56->dsp_wq) + destroy_workqueue(cs35l56->dsp_wq); + return ret; } EXPORT_SYMBOL_NS_GPL(cs35l56_common_probe, "SND_SOC_CS35L56_CORE"); -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup 2026-05-05 16:11 [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 1/2] ASoC: cs35l56: Don't use devres to unregister component Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 2/2] ASoC: cs35l56: Destroy workqueue in probe error path Richard Fitzgerald @ 2026-05-06 12:22 ` Mark Brown 2 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2026-05-06 12:22 UTC (permalink / raw) To: Richard Fitzgerald; +Cc: linux-sound, linux-kernel, patches On Tue, 05 May 2026 17:11:22 +0100, Richard Fitzgerald wrote: > ASoC: cs35l56: Fixes for driver cleanup > > Two patches to fix cleanup during driver remove() and the error path > of probe(). > > The main purpose is to fix cleanup of the workqueue. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1 Thanks! [1/2] ASoC: cs35l56: Don't use devres to unregister component https://git.kernel.org/broonie/sound/c/bee87cf0f124 [2/2] ASoC: cs35l56: Destroy workqueue in probe error path https://git.kernel.org/broonie/sound/c/fd4d83e1437d All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-06 14:08 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-05 16:11 [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 1/2] ASoC: cs35l56: Don't use devres to unregister component Richard Fitzgerald 2026-05-05 16:11 ` [PATCH v2 2/2] ASoC: cs35l56: Destroy workqueue in probe error path Richard Fitzgerald 2026-05-06 12:22 ` [PATCH v2 0/2] ASoC: cs35l56: Fixes for driver cleanup Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox