* [PATCH] ASoC: codecs: rt5682s: disable jack detection work on shutdown
@ 2026-10-03 4:10 Myeonghun Pak
2026-10-05 13:40 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-10-03 4:10 UTC (permalink / raw)
To: Oder Chiou, Mark Brown, Liam Girdwood
Cc: Jaroslav Kysela, Takashi Iwai, Derek Fang, linux-sound,
linux-kernel, stable, Ijae Kim
The jack detection and button check works can queue each other. The
shutdown path cancels jack_detect_work first, but jd_check_work can
queue it again after that cancellation returns. Canceling jd_check_work
then leaves jack_detect_work pending or running while the device is
reset and, on removal, its managed resources are released.
Disable and drain both delayed works so neither callback can revive the
other after its cancellation. The I2C remove callback uses the same
shutdown path.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: c07ac3ee76e5 ("ASoC: rt5682s: Fix the wrong jack type detected")
Cc: stable@vger.kernel.org # 6.10+
Assisted-by: LLM
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/rt5682s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c
index 34997cfb465b..7a196fab623a 100644
--- a/sound/soc/codecs/rt5682s.c
+++ b/sound/soc/codecs/rt5682s.c
@@ -3294,8 +3294,8 @@ static void rt5682s_i2c_shutdown(struct i2c_client *client)
struct rt5682s_priv *rt5682s = i2c_get_clientdata(client);
disable_irq(client->irq);
- cancel_delayed_work_sync(&rt5682s->jack_detect_work);
- cancel_delayed_work_sync(&rt5682s->jd_check_work);
+ disable_delayed_work_sync(&rt5682s->jack_detect_work);
+ disable_delayed_work_sync(&rt5682s->jd_check_work);
rt5682s_reset(rt5682s);
}
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: codecs: rt5682s: disable jack detection work on shutdown
2026-10-03 4:10 [PATCH] ASoC: codecs: rt5682s: disable jack detection work on shutdown Myeonghun Pak
@ 2026-10-05 13:40 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-10-05 13:40 UTC (permalink / raw)
To: Oder Chiou, Liam Girdwood, Myeonghun Pak
Cc: Jaroslav Kysela, Takashi Iwai, Derek Fang, linux-sound,
linux-kernel, stable, Ijae Kim
On Sat, 03 Oct 2026 00:10:45 -0400, Myeonghun Pak wrote:
> ASoC: codecs: rt5682s: disable jack detection work on shutdown
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: codecs: rt5682s: disable jack detection work on shutdown
https://git.kernel.org/broonie/sound/c/ca552e3140e7
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] 2+ messages in thread
end of thread, other threads:[~2026-10-06 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-03 4:10 [PATCH] ASoC: codecs: rt5682s: disable jack detection work on shutdown Myeonghun Pak
2026-10-05 13:40 ` Mark Brown
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®