Commit 0fc28fc0 authored by Takashi Iwai's avatar Takashi Iwai

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@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 09d2014f
...@@ -4000,6 +4000,10 @@ static void hda_call_codec_resume(struct hda_codec *codec) ...@@ -4000,6 +4000,10 @@ static void hda_call_codec_resume(struct hda_codec *codec)
* in the resume / power-save sequence * in the resume / power-save sequence
*/ */
hda_keep_power_on(codec); 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); hda_set_power_state(codec, AC_PWRST_D0);
restore_shutup_pins(codec); restore_shutup_pins(codec);
hda_exec_init_verbs(codec); hda_exec_init_verbs(codec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment