BACKPORT: ALSA: hda - Clear the power-saving states properly at reset
authorTakashi Iwai <tiwai@suse.de>
Tue, 8 May 2012 14:57:12 +0000 (16:57 +0200)
committerGerrit <chrome-bot@google.com>
Fri, 15 Jun 2012 21:34:51 +0000 (14:34 -0700)
Some power-saving states have been left unchanged in
snd_hda_codec_reset(), and this is a potential danger because the
function may be called in various situations including the continuous
operation after that call.

BUG=chrome-os-partner:10399
TEST=suspend and resume hda codec.

Change-Id: Ia5c25f4920a74c51e29f9cacba47eb2d7bea4ed0
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
(cherry picked from commit 339876d70a5794c0d5fe09d37827c63148d5017a)
Reviewed-on: https://gerrit.chromium.org/gerrit/25322
Reviewed-by: Olof Johansson <olofj@chromium.org>
sound/pci/hda/hda_codec.c

index b284e8f..bf74c3b 100644 (file)
@@ -2265,6 +2265,9 @@ int snd_hda_codec_reset(struct hda_codec *codec)
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
        cancel_delayed_work(&codec->power_work);
+       codec->power_on = 0;
+       codec->power_transition = 0;
+       codec->power_jiffies = jiffies;
        flush_workqueue(codec->bus->workq);
 #endif
        snd_hda_ctls_clear(codec);