diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2007-09-03 09:26:57 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:59:46 -0400 |
commit | 2e4924628ad957f702631a7a049c586a780f00f8 (patch) | |
tree | e0a653b659c8bb8a17c7d26b054bd9b7f4548ef1 /sound/pci/hda/hda_codec.c | |
parent | b7e054a76fdc42b442c003f8d19ee5dce6b55f02 (diff) |
[ALSA] hda-intel - fix a race in dynamic power managment
codec->power_transition is supposed to be true while codec is going
to be shut off if in the mean time somebody calls snd_hda_power_up,
hda_power_work will not shut down the codec, but nether will clear
codec->power_transition, thus it stays on forever. Fix this.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 46d4253642d7..08104e2a3e99 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2195,8 +2195,10 @@ static void hda_power_work(struct work_struct *work) | |||
2195 | struct hda_codec *codec = | 2195 | struct hda_codec *codec = |
2196 | container_of(work, struct hda_codec, power_work.work); | 2196 | container_of(work, struct hda_codec, power_work.work); |
2197 | 2197 | ||
2198 | if (!codec->power_on || codec->power_count) | 2198 | if (!codec->power_on || codec->power_count) { |
2199 | codec->power_transition = 0; | ||
2199 | return; | 2200 | return; |
2201 | } | ||
2200 | 2202 | ||
2201 | hda_call_codec_suspend(codec); | 2203 | hda_call_codec_suspend(codec); |
2202 | if (codec->bus->ops.pm_notify) | 2204 | if (codec->bus->ops.pm_notify) |