This is a note to let you know that I've just added the patch titled ASoC: rt5640: Only cancel jack-detect work on suspend if active to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-rt5640-only-cancel-jack-detect-work-on-suspend-.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6f7626db95fa31ab88104afd3c0c37850b9323f7 Author: Hans de Goede <hdegoede@xxxxxxxxxx> Date: Tue Sep 12 13:32:45 2023 +0200 ASoC: rt5640: Only cancel jack-detect work on suspend if active [ Upstream commit 8fc7cc507d61fc655172836c74fb7fcc8b7a978b ] If jack-detection is not used; or has already been disabled then there is no need to call rt5640_cancel_work(). Move the rt5640_cancel_work() inside the "if (rt5640->jack) {}" block, grouping it together with the disabling of the IRQ which queues the work in the first place. This also makes suspend() symetrical with resume() which re-queues the work in an "if (rt5640->jack) {}" block. Cc: Oder Chiou <oder_chiou@xxxxxxxxxxx> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230912113245.320159-7-hdegoede@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index a39d556ad1a10..0a05554da3739 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2802,9 +2802,9 @@ static int rt5640_suspend(struct snd_soc_component *component) if (rt5640->jack) { /* disable jack interrupts during system suspend */ disable_irq(rt5640->irq); + rt5640_cancel_work(rt5640); } - rt5640_cancel_work(rt5640); snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); rt5640_reset(component); regcache_cache_only(rt5640->regmap, true);