Skip to content

Commit a6cd64e

Browse files
cristiccgregkh
authored andcommitted
ASoC: nau8821: Cancel pending work before suspend
[ Upstream commit 7786b10 ] A jack detection work that is unscheduled or in progress while executing the suspend handler could trigger a race condition. Ensure state consistency by cancelling any pending work or wait for its execution to complete before processing the suspend. Since driver (re)enables both insert and eject interrupts on resume, there is no risk to miss the related jack events. Therefore, flush_delayed_work() is not required here. Fixes: aab1ad1 ("ASoC: nau8821: new driver") Fixes: ee70bac ("ASoC: nau8821: Avoid unnecessary blocking in IRQ handler") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://patch.msgid.link/20251231-nau8821-cleanup-v1-3-6b0b76cbbb64@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent bea242c commit a6cd64e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/soc/codecs/nau8821.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,10 @@ static int __maybe_unused nau8821_suspend(struct snd_soc_component *component)
16121612

16131613
if (nau8821->irq)
16141614
disable_irq(nau8821->irq);
1615+
1616+
if (nau8821->jdet_active)
1617+
cancel_delayed_work_sync(&nau8821->jdet_work);
1618+
16151619
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
16161620
/* Power down codec power; don't support button wakeup */
16171621
snd_soc_component_disable_pin(component, "MICBIAS");

0 commit comments

Comments
 (0)