summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2012-06-21 21:51:22 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-09 08:22:38 -0700
commita491efddf2e4696794f17a38c77433409a8a52bb (patch)
tree0d3323291c53e6ba14372c2dea1f864458dbf79e /sound
parent7eb31a7c9f3d531078e85e461a35db20d3c74ba7 (diff)
ALSA: hda - Don't power up when not powered down.
commit b43d224767e426cf1a8b6622d1d172f2b2b0e857 upstream. After cancel_delayed_work_sync returns, the power down work either never started (power_on == 1) or finished (power_on == 0). In the former case there is no need to power up again. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 51cb2a2e4fce..4e17033fd234 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4418,6 +4418,13 @@ static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down)
cancel_delayed_work_sync(&codec->power_work);
spin_lock(&codec->power_lock);
+ /* If the power down delayed work was cancelled above before starting,
+ * then there is no need to go through power up here.
+ */
+ if (codec->power_on) {
+ spin_unlock(&codec->power_lock);
+ return;
+ }
trace_hda_power_up(codec);
snd_hda_update_power_acct(codec);
codec->power_on = 1;