* [PATCH] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
@ 2026-11-04 12:23 Richard Fitzgerald
2026-11-04 14:44 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2026-11-04 12:23 UTC (permalink / raw)
To: tiwai; +Cc: linux-sound, linux-kernel, patches
In cs35l56_hda_unbind() call cs_dsp_stop() before cs_dsp_power_down()
if cs_dsp is in a running state.
cs35l56_hda_runtime_resume() calls cs_dsp_run() if cs_dsp_power_up() has
previously run successfully. If cs35l56_hda_unbind() is then called while
in this runtime-resumed state cs_dsp will be running. The code wasn't
checking for this and was calling cs_dsp_power_down() while still in a
running state, which is illegal. This is currently fairly harmless for
the cs35l56 driver. But it doesn't comply with the API, so potentially
could break with any future changes that expect the correct API use.
Fixes: fb78d73dde2d4 ("ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/side-codecs/cs35l56_hda.c
index 148d760987fdd..5982eebae1525 100644
--- a/sound/hda/codecs/side-codecs/cs35l56_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c
@@ -809,6 +809,8 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
cs_dsp_cleanup_debugfs(&cs35l56->cs_dsp);
debugfs_remove_recursive(cs35l56->debugfs_root);
#endif
+ if (cs35l56->cs_dsp.running)
+ cs_dsp_stop(&cs35l56->cs_dsp);
if (cs35l56->cs_dsp.booted)
cs_dsp_power_down(&cs35l56->cs_dsp);
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
2026-11-04 12:23 [PATCH] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Richard Fitzgerald
@ 2026-11-04 14:44 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-11-04 14:44 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: tiwai, linux-sound, linux-kernel, patches
On Wed, 04 Nov 2026 13:23:37 +0100,
Richard Fitzgerald wrote:
>
> In cs35l56_hda_unbind() call cs_dsp_stop() before cs_dsp_power_down()
> if cs_dsp is in a running state.
>
> cs35l56_hda_runtime_resume() calls cs_dsp_run() if cs_dsp_power_up() has
> previously run successfully. If cs35l56_hda_unbind() is then called while
> in this runtime-resumed state cs_dsp will be running. The code wasn't
> checking for this and was calling cs_dsp_power_down() while still in a
> running state, which is illegal. This is currently fairly harmless for
> the cs35l56 driver. But it doesn't comply with the API, so potentially
> could break with any future changes that expect the correct API use.
>
> Fixes: fb78d73dde2d4 ("ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()")
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-04 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 12:23 [PATCH] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Richard Fitzgerald
2026-11-04 14:44 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®