mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt5682: disable jack detection works on shutdown
@ 2026-11-10  4:30 Myeonghun Pak
  0 siblings, 0 replies; only message in thread
From: Myeonghun Pak @ 2026-11-10  4:30 UTC (permalink / raw)
  To: Oder Chiou, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, linux-kernel, stable, Ijae Kim

rt5682_i2c_shutdown(), which is also the remove path, cancels
jack_detect_work before jd_check_work. With a headset button held,
jd_check_work can observe jack removal and queue jack_detect_work
after the first cancel. That work can then run after the codec is
reset or, on remove, after the driver data is freed.

Use disable_delayed_work_sync() for both works, which can queue each
other, to drain them and prevent requeueing. Probe initializes fresh
work on rebind.

Found by a static analysis tool under development.

Fixes: 45a2702ce109 ("ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown")
Cc: stable@vger.kernel.org # v6.10+
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>

---

 sound/soc/codecs/rt5682-i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c
index 43132943f6a7..db820cd9acba 100644
--- a/sound/soc/codecs/rt5682-i2c.c
+++ b/sound/soc/codecs/rt5682-i2c.c
@@ -299,8 +299,8 @@ static void rt5682_i2c_shutdown(struct i2c_client *client)
 	struct rt5682_priv *rt5682 = i2c_get_clientdata(client);
 
 	disable_irq(client->irq);
-	cancel_delayed_work_sync(&rt5682->jack_detect_work);
-	cancel_delayed_work_sync(&rt5682->jd_check_work);
+	disable_delayed_work_sync(&rt5682->jack_detect_work);
+	disable_delayed_work_sync(&rt5682->jd_check_work);
 
 	rt5682_reset(rt5682);
 }

base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-10  4:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10  4:30 [PATCH] ASoC: rt5682: disable jack detection works on shutdown Myeonghun Pak

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®