]> git.hungrycats.org Git - linux/commit
ALSA: hda/cs35l41: Fix firmware load work teardown
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Mon, 11 May 2026 04:29:34 +0000 (01:29 -0300)
committerTakashi Iwai <tiwai@suse.de>
Fri, 15 May 2026 15:54:47 +0000 (17:54 +0200)
commitb65020d5398f499c09498c9786dba6d67ae57664
treee6cf5f104e5a3522b2a755af15cfe51cb22c7fd8
parentc77a6cbb36ff8cbc1f084d94f8dcda5250935271
ALSA: hda/cs35l41: Fix firmware load work teardown

cs35l41_hda creates ALSA controls whose private data points at the
cs35l41_hda object. The firmware load control can also queue
fw_load_work.

Those controls are not removed on component unbind, and device remove
only cancels fw_load_work through cs35l41_remove_dsp(). That helper is
skipped when halo_initialized is false. With firmware_autostart
disabled, a firmware load can be requested before the DSP has been
initialized. If the component or device is removed before the queued
work runs, the worker can run after teardown and dereference driver
state that is no longer valid.

Track the created controls and remove them on unbind so no new control
callback can reach the driver data or queue more work. Then cancel
fw_load_work to drain any request that was already queued. Also cancel
the work unconditionally during device remove before runtime PM teardown.

Fixes: 47ceabd99a28 ("ALSA: hda: cs35l41: Support Firmware switching and reloading")
Fixes: 4c870513fbb0 ("ALSA: hda: cs35l41: Add read-only ALSA control for forced mute")
Cc: stable@vger.kernel.org
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Reviewed-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260511-alsa-hda-cs35l41-fw-work-teardown-v1-1-1184e9bc4f25@gmail.com
sound/hda/codecs/side-codecs/cs35l41_hda.c
sound/hda/codecs/side-codecs/cs35l41_hda.h