UPSTREAM: ALSA: hda - Fix leftover codec->power_transition
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Aug 2012 19:25:22 +0000 (21:25 +0200)
committerGerrit <chrome-bot@google.com>
Fri, 12 Oct 2012 17:12:39 +0000 (10:12 -0700)
When the codec turn-on operation is canceled by the immediate
power-on, the driver left the power_transition flag as is.
This caused the persistent avoidance of power-save behavior.

Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 535b6c51fe8293c88ce919cdfc4390c67a1cb6d1)

BUG=chrome-os-partner:15121
TEST=turn on tracepoints for hda_power_up/hda_power_down and verify
hda_power_down is called after specified timeout.

Change-Id: I023c7aedbbb77e1f68c2b45ebad7e29101089df5
Reviewed-on: https://gerrit.chromium.org/gerrit/35399
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
sound/pci/hda/hda_codec.c

index 82ec7e8..ed4e7e6 100644 (file)
@@ -4360,6 +4360,8 @@ static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down)
         * then there is no need to go through power up here.
         */
        if (codec->power_on) {
+               if (codec->power_transition < 0)
+                       codec->power_transition = 0;
                spin_unlock(&codec->power_lock);
                return;
        }