ALSA: hda - Fix unbalanced runtime PM notification at resume

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:11 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0fc28fc030a85aa3d6d14e9e9fca0c8237c9ffb5
Commit:     0fc28fc030a85aa3d6d14e9e9fca0c8237c9ffb5
Parent:     09d2014fb0c6bcd0bf60f46e890907facd25d22c
Author:     Takashi Iwai <tiwai at suse.de>
AuthorDate: Wed Nov 20 12:15:07 2013 +0100
Committer:  Takashi Iwai <tiwai at suse.de>
CommitDate: Wed Nov 20 16:39:14 2013 +0100

    ALSA: hda - Fix unbalanced runtime PM notification at resume
    
    When a codec is resumed, it keeps the power on while the resuming
    phase via hda_keep_power_on(), then turns down via
    snd_hda_power_down().  At that point, snd_hda_power_down() notifies
    the power down to the controller, and this may confuse the refcount if
    the codec was already powered up before the resume.
    
    In the end result, the controller goes to runtime suspend even before
    the codec is kicked off to the power save, and the communication
    stalls happens.
    
    The fix is to add the power-up notification together with
    hda_keep_power_on(), and clears the flag appropriately.
    
    Cc: <stable at vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/hda/hda_codec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index afb90f4..69178c4 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4000,6 +4000,10 @@ static void hda_call_codec_resume(struct hda_codec *codec)
 	 * in the resume / power-save sequence
 	 */
 	hda_keep_power_on(codec);
+	if (codec->pm_down_notified) {
+		codec->pm_down_notified = 0;
+		hda_call_pm_notify(codec->bus, true);
+	}
 	hda_set_power_state(codec, AC_PWRST_D0);
 	restore_shutup_pins(codec);
 	hda_exec_init_verbs(codec);



More information about the linux-mtd-cvs mailing list