This avoids a potential deadlock with cancellation and races with completion on insertion.
Signed-off-by: Mark Brown broonie@opensource.wolfsonmicro.com --- sound/soc/codecs/wm8994.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index b66435f..d6e994d 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3578,6 +3578,8 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) int reg, delay; bool present;
+ cancel_delayed_work_sync(&wm8994->mic_work); + pm_runtime_get_sync(codec->dev);
mutex_lock(&wm8994->accdet_lock); @@ -3612,8 +3614,6 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) } else { dev_dbg(codec->dev, "Jack not detected\n");
- cancel_delayed_work_sync(&wm8994->mic_work); - snd_soc_update_bits(codec, WM8958_MICBIAS2, WM8958_MICB2_DISCH, WM8958_MICB2_DISCH);