Skip to content

Commit

Permalink
ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4
Browse files Browse the repository at this point in the history
When a machine goes to S3/S4 after power-save is enabled, the runtime
PM refcount might be incorrectly decreased because the power-down
triggered soon after resume assumes that the controller was already
powered up, and issues the pm_notify down.

This patch fixes the incorrect pm_notify call simply by checking the
current value properly.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Oct 24, 2013
1 parent d7f8761 commit e6bbe66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4864,8 +4864,8 @@ static void hda_power_work(struct work_struct *work)
spin_unlock(&codec->power_lock);

state = hda_call_codec_suspend(codec, true);
codec->pm_down_notified = 0;
if (!bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) {
if (!codec->pm_down_notified &&
!bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) {
codec->pm_down_notified = 1;
hda_call_pm_notify(bus, false);
}
Expand Down

0 comments on commit e6bbe66

Please sign in to comment.