diff options
author | Dylan Reid <dgreid@chromium.org> | 2012-09-28 15:57:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-13 05:50:33 +0900 |
commit | 22e22876160b6b19e4aa52d8e562149840945e9b (patch) | |
tree | d28ca9af95676140633f191ea2fe8674c2cdb206 /net/lapb/lapb_out.c | |
parent | 93bfa6e4dade09e6b92a84990f479c3d59a69e14 (diff) |
ALSA: hda - Fix hang caused by race during suspend.
commit d17344b3547669f5b6ee4fda993d03737a141bd6 upstream.
There was a race condition when the system suspends while hda_power_work
is running in the work queue. If system suspend (snd_hda_suspend)
happens after the work queue releases power_lock but before it calls
hda_call_codec_suspend, codec_suspend runs with power_on=0, causing the
codec to power up for register reads, and hanging when it calls
cancel_delayed_work_sync from the running work queue.
The call chain from the work queue will look like this:
hda_power_work <<- power_on = 1, unlock, then power_on cleard by suspend
hda_call_codec_suspend
hda_set_power_state
snd_hda_codec_read
codec_exec_verb
snd_hda_power_up
snd_hda_power_save
__snd_hda_power_up
cancel_delayed_work_sync <<-- cancelling executing wq
Fix this by waiting for the work queue to finish before starting suspend
if suspend is not happening on the work queue.
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 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions