From: Takashi Iwai Date: Wed, 23 Oct 2013 23:20:24 +0000 (+0200) Subject: ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4 X-Git-Tag: upstream/snapshot3+hdmi~4072^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6bbe666673ab044a3d39ddb74e4d9a401cf1d6f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4 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: Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 5b6c4e3..748c6a9 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -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); }