]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 8 May 2012 16:01:01 +0000 (18:01 +0200)
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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c

index e134e7212cd98259d036c045d69fb79f03d5e29f..8bd34320ef91f0a6d883a2fc1468db63bec164c3 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);