]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Handle pm failure during hotplug
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 27 Jun 2018 06:25:32 +0000 (07:25 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 2 Jul 2018 14:14:05 +0000 (16:14 +0200)
commitdb27ba0095ffad2a7f6a70a1c525ba827d13cb8e
tree7413d6a56e08e86072b672d4937c0d8f20240a0f
parent49681c7374bbb609db4b7960aa384253bde12e57
ALSA: hda - Handle pm failure during hotplug

Obtaining the runtime pm wakeref can fail, especially in a hotplug
scenario where i915.ko has been unloaded. If we do not catch the
failure, we end up with an unbalanced pm.

v2 additions by tiwai:
hdmi_present_sense() checks the return value and handle only a
negative error case and bails out only if it's really still suspended.
Also, snd_hda_power_down() is called at the error path so that the
refcount is balanced.

Along with it, the spec->pcm_lock is taken outside
hdmi_present_sense() in the caller side, so that it won't cause
deadlock at reentrace via runtime resume.

v3 fix by tiwai:
Missing linux/pm_runtime.h is included.

References: b5259575816d ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c