From: Maxim Levitsky Date: Mon, 3 Sep 2007 13:26:57 +0000 (+0200) Subject: [ALSA] hda-intel - fix a race in dynamic power managment X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2e4924628ad957f702631a7a049c586a780f00f8;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- 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) struct hda_codec *codec = container_of(work, struct hda_codec, power_work.work); - if (!codec->power_on || codec->power_count) + if (!codec->power_on || codec->power_count) { + codec->power_transition = 0; return; + } hda_call_codec_suspend(codec); if (codec->bus->ops.pm_notify)