This is a note to let you know that I've just added the patch titled

    ASoC: wm8994: Prevent double lock of accdet_lock mutex on wm1811

to the 3.16-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-wm8994-prevent-double-lock-of-accdet_lock-mutex-on-wm1811.patch
and it can be found in the queue-3.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From b38314179c9ccb789e6fe967cff171fa817e8978 Mon Sep 17 00:00:00 2001
From: Charles Keepax <[email protected]>
Date: Mon, 16 Jun 2014 21:24:03 +0100
Subject: ASoC: wm8994: Prevent double lock of accdet_lock mutex on wm1811

From: Charles Keepax <[email protected]>

commit b38314179c9ccb789e6fe967cff171fa817e8978 upstream.

wm1811_micd_stop takes the accdet_lock mutex, and is called from two
places, one of which is already holding the accdet_lock. This obviously
causes a lock up.

This patch fixes this issue by removing the lock from wm1811_micd_stop
and ensuring that it is always locked externally.

Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 sound/soc/codecs/wm8994.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3505,6 +3505,7 @@ static irqreturn_t wm8994_mic_irq(int ir
        return IRQ_HANDLED;
 }
 
+/* Should be called with accdet_lock held */
 static void wm1811_micd_stop(struct snd_soc_codec *codec)
 {
        struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -3512,14 +3513,10 @@ static void wm1811_micd_stop(struct snd_
        if (!wm8994->jackdet)
                return;
 
-       mutex_lock(&wm8994->accdet_lock);
-
        snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0);
 
        wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_JACK);
 
-       mutex_unlock(&wm8994->accdet_lock);
-
        if (wm8994->wm8994->pdata.jd_ext_cap)
                snd_soc_dapm_disable_pin(&codec->dapm,
                                         "MICBIAS2");
@@ -3560,10 +3557,10 @@ static void wm8958_open_circuit_work(str
                                                  open_circuit_work.work);
        struct device *dev = wm8994->wm8994->dev;
 
-       wm1811_micd_stop(wm8994->hubs.codec);
-
        mutex_lock(&wm8994->accdet_lock);
 
+       wm1811_micd_stop(wm8994->hubs.codec);
+
        dev_dbg(dev, "Reporting open circuit\n");
 
        wm8994->jack_mic = false;


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.16/asoc-wm8994-prevent-double-lock-of-accdet_lock-mutex-on-wm1811.patch
queue-3.16/asoc-wm_adsp-add-missing-module_license.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to