Chris Wilson aaa23f8600 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: 222bde03881c ("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>
2018-07-02 16:14:05 +02:00
..
2017-09-04 14:50:49 +02:00
2018-06-15 18:10:01 -03:00
2018-06-12 16:19:22 -07:00
2017-11-13 15:45:57 +01:00
2018-06-07 12:34:37 -07:00
2017-11-13 15:45:57 +01:00
2018-06-15 17:24:40 +09:00
2018-05-31 09:11:03 +02:00