]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Fix mutex deadlock in HDMI codec driver
authorTakashi Iwai <tiwai@suse.de>
Tue, 29 Oct 2019 20:41:20 +0000 (21:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 30 Oct 2019 14:32:37 +0000 (15:32 +0100)
commit69beae681947fe7367d8bf14f0eefd11774b6ab2
treeb36a354c7572ab6773c0f19c968044af9955eed6
parent5ebc3866e0fa8fc12487a8ee4c276e4ae49bc6b1
ALSA: hda - Fix mutex deadlock in HDMI codec driver

The commit 16bc23335438 ("ALSA: hda/hdmi - Allow audio component for
AMD/ATI and Nvidia HDMI") introduced the spec->pcm_lock mutex lock to
the whole generic_hdmi_init() function for avoiding the race with the
audio component registration.  However, this caused a dead lock when
the unsolicited event is handled without the audio component, as the
codec gets runtime-resumed in hdmi_present_sense() which is already
inside the spec->pcm_lock in its caller.

For avoiding this deadlock, add a new mutex only for the audio
component binding that is used in both generic_hdmi_init() and the
audio notifier registration where the jack callbacks are handled /
re-registered.

Fixes: 16bc23335438 ("ALSA: hda/hdmi - Allow audio component for AMD/ATI and Nvidia HDMI")
Reported-and-tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/s5himo7i89i.wl-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c