Skip to content

Commit 9529dc1

Browse files
mszyprowbroonie
authored andcommitted
ASoC: wm8994: Fix potential deadlock
Fix this by dropping wm8994->accdet_lock while calling cancel_delayed_work_sync(&wm8994->mic_work) in wm1811_jackdet_irq(). Fixes: c0cc3f1 ("ASoC: wm8994: Allow a delay between jack insertion and microphone detect") Signed-off-by: Marek Szyprowski <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 83f1b7f commit 9529dc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sound/soc/codecs/wm8994.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,7 +3853,12 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
38533853
} else {
38543854
dev_dbg(component->dev, "Jack not detected\n");
38553855

3856+
/* Release wm8994->accdet_lock to avoid deadlock:
3857+
* cancel_delayed_work_sync() takes wm8994->mic_work internal
3858+
* lock and wm1811_mic_work takes wm8994->accdet_lock */
3859+
mutex_unlock(&wm8994->accdet_lock);
38563860
cancel_delayed_work_sync(&wm8994->mic_work);
3861+
mutex_lock(&wm8994->accdet_lock);
38573862

38583863
snd_soc_component_update_bits(component, WM8958_MICBIAS2,
38593864
WM8958_MICB2_DISCH, WM8958_MICB2_DISCH);

0 commit comments

Comments
 (0)