ALSA: hda - Fix unbalanced runtime PM notification at resume
authorTakashi Iwai <tiwai@suse.de>
Wed, 20 Nov 2013 11:15:07 +0000 (12:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:28:01 +0000 (11:28 -0800)
commit030d2a71328b25939ec5e31c5180b5f95dc8fe54
tree4a42d10271e631f91c092563d4f2e7e931004a02
parentb2f7d06dcd2ef9bb082a7933a974fbe67f2dd842
ALSA: hda - Fix unbalanced runtime PM notification at resume

commit 0fc28fc030a85aa3d6d14e9e9fca0c8237c9ffb5 upstream.

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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_codec.c