[Intel-gfx] [PATCH] ALSA: hda - Handle pm failure during hotplug

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 27 06:25:32 UTC 2018


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.

References: 222bde03881c ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Takashi Iwai <tiwai at suse.de>
Cc: Vinod Koul <vinod.koul at intel.com>
---
 sound/pci/hda/patch_hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 7d7eb1354eee..3ca98c9fcaee 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1632,8 +1632,8 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 	int ret;
 
 	/* no temporary power up/down needed for component notifier */
-	if (!codec_has_acomp(codec))
-		snd_hda_power_up_pm(codec);
+	if (!codec_has_acomp(codec) && snd_hda_power_up_pm(codec))
+		return false;
 
 	mutex_lock(&spec->pcm_lock);
 	if (codec_has_acomp(codec)) {
-- 
2.18.0



More information about the Intel-gfx mailing list