Skip to content

Commit 9ad1f3c

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: Fix deadlock when the failing IPC is SET_D0IX
The procedure handling IPC timeouts and EXCEPTION_CAUGHT notification shall cancel any D0IX work before proceeding with DSP recovery. If SET_D0IX called from delayed_work is the failing IPC the procedure will deadlock. Conditionally skip cancelling the work to fix that. Fixes: 335c4cb ("ASoC: Intel: avs: D0ix power state support") Reviewed-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ff0045d commit 9ad1f3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/intel/avs/ipc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ static void avs_dsp_exception_caught(struct avs_dev *adev, union avs_notify_msg
169169

170170
dev_crit(adev->dev, "communication severed, rebooting dsp..\n");
171171

172-
cancel_delayed_work_sync(&ipc->d0ix_work);
172+
/* Avoid deadlock as the exception may be the response to SET_D0IX. */
173+
if (current_work() != &ipc->d0ix_work.work)
174+
cancel_delayed_work_sync(&ipc->d0ix_work);
173175
ipc->in_d0ix = false;
174176
/* Re-enabled on recovery completion. */
175177
pm_runtime_disable(adev->dev);

0 commit comments

Comments
 (0)