[Xenial,1/3] ALSA: hda - Skip ELD notification during PM process
diff mbox

Message ID 1467769687-4777-2-git-send-email-hui.wang@canonical.com
State New
Headers show

Commit Message

Hui Wang July 6, 2016, 1:48 a.m. UTC
From: Takashi Iwai <tiwai@suse.de>

BugLink: http://bugs.launchpad.net/bugs/1596871

The ELD notification can be received asynchronously from the graphics
side, and this may happen just at the moment the sound driver is
processing the suspend or the resume, and it would confuse the whole
procedure.  Since the ELD and connection states are updated in anyway
at the end of the resume, we can skip it when received during PM

Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit eb399d3c99d8b411bfc46e67ea329ddc1ca64e87)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
 sound/pci/hda/patch_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff mbox

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 70c9456..5b6caca 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2358,6 +2358,9 @@  static void intel_pin_eld_notify(void *audio_ptr, int port)
 	if (snd_power_get_state(codec->card) != SNDRV_CTL_POWER_D0)
+	/* ditto during suspend/resume process itself */
+	if (atomic_read(&(codec)->core.in_pm))
+		return;
 	check_presence_and_report(codec, pin_nid);