ASoC: rt5682: disable jack detection works on shutdown
Subsystems (4)
PATCH 1/1 ASoC: rt5682: disable jack detection works on shutdown
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.
---
sound/soc/codecs/rt5682-i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5682-i2c.c +2 -2
@@ -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
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 1 line · Myeonghun Pak
ASoC: rt5682: disable jack detection works on shutdown
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/1] ASoC: rt5682: disable jack detection works on shutdown
https://git.kernel.org/broonie/sound/c/b45849311e88
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