]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Use nested lock for snd_soc_dapm_mutex_lock
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tue, 29 Dec 2015 16:25:13 +0000 (16:25 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 30 Dec 2015 16:48:13 +0000 (16:48 +0000)
commit9654de6489c74fbfdc528c399b25d073234f8625
tree5fc9e0b95a11e500efe7e1f1addff5fc56853913
parent837e0eb1c9d194f0eb3cf87d97b2235de146c9fe
ASoC: Use nested lock for snd_soc_dapm_mutex_lock

snd_soc_dapm_mutex_lock currently uses the un-nested call which can
cause lockdep warnings when called from control handlers (a relatively
common usage) and using modules. As creating the control causes a
potential mutex inversion with the handler, creating the control will
take the controls_rwsem under the dapm_mutex and accessing the control
will take the dapm_mutex under controls_rwsem.

All the users look like they want to be using the runtime class of the
lock anyway, so this patch just changes snd_soc_dapm_mutex_lock to use
the nested call, with the SND_SOC_DAPM_CLASS_RUNTIME class.

Fixes: aa39c33d16a8 ("ASoC: dapm: Add helpers to lock/unlock DAPM mutex")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h