]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - sound/soc/stm/stm32_spdifrx.c
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 05:29:37 +0000 (00:29 -0500)
commit6b6f099c8c13f85c31eb85c537d1d18d68ca67b9
treed3802ce89c8159d28ba4a82ea7755d31513fda07
parenta9533dff6d3534a32bd2da0c7e1bbfca4e7dddd2
ASoC: stm32: spdifrx: fix inconsistent lock state

BugLink: https://bugs.launchpad.net/bugs/1861934
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