Commit 16037643 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix cancel_work_sync() stall from jackpoll work

On AMD/ATI controllers, the HD-audio controller driver allows a bus
reset upon the error recovery, and its procedure includes the
cancellation of pending jack polling work as found in
snd_hda_bus_codec_reset().  This works usually fine, but it becomes a
problem when the reset happens from the jack poll work itself; then
calling cancel_work_sync() from the work being processed tries to wait
the finish endlessly.

As a workaround, this patch adds the check of current_work() and
applies the cancel_work_sync() only when it's not from the

This doesn't fix the root cause of the reported error below, but at
least, it eases the unexpected stall of the whole system.

Cc: <>
Cc: Lukas Wunner <>
Signed-off-by: default avatarTakashi Iwai <>
parent 5b394b2d
......@@ -3935,7 +3935,8 @@ void snd_hda_bus_reset_codecs(struct hda_bus *bus)
list_for_each_codec(codec, bus) {
/* FIXME: maybe a better way needed for forced reset */
if (current_work() != &codec->
#ifdef CONFIG_PM
if (hda_codec_is_power_on(codec)) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment