• Charles Keepax's avatar
    ASoC: Use nested lock for snd_soc_dapm_mutex_lock · 27de4a14
    Charles Keepax authored
    commit 783513ee upstream.
    
    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: f6d5e586 ("ASoC: dapm: Add helpers to lock/unlock DAPM mutex")
    Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    27de4a14
soc.h 51 KB