mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
ALSA: hda - Don't power up when not powered down.
commit b43d224767 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7eb31a7c9f
commit
a491efddf2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user