]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ASoC: stm32: spdifrx: fix inconsistent lock state
authorOlivier Moysan <olivier.moysan@st.com>
Wed, 4 Dec 2019 15:43:31 +0000 (16:43 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
commitf5854ef635ac12432934d8b1a419e8366af0f093
tree98cc6451650eda8fcd3815211dd4fc17c114e530
parent98b5c45d997ccd789619d83a7ce3c469bf209d38
ASoC: stm32: spdifrx: fix inconsistent lock state

BugLink: https://bugs.launchpad.net/bugs/1862227
commit 2859b1784031b5709446af8f6039c467f136e67d upstream.

In current spdifrx driver locks may be requested as follows:
- request lock on iec capture control, when starting synchronization.
- request lock in interrupt context, when spdifrx stop is called
from IRQ handler.

Take lock with IRQs disabled, to avoid the possible deadlock.

Lockdep report:
[   74.278059] ================================
[   74.282306] WARNING: inconsistent lock state
[   74.290120] --------------------------------
...
[   74.314373]        CPU0
[   74.314377]        ----
[   74.314381]   lock(&(&spdifrx->lock)->rlock);
[   74.314396]   <Interrupt>
[   74.314400]     lock(&(&spdifrx->lock)->rlock);

Fixes: 03e4d5d56fa5 ("ASoC: stm32: Add SPDIFRX support")
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20191204154333.7152-2-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/soc/stm/stm32_spdifrx.c