Skip to content

Commit 366f05e

Browse files
unnathi84andersson
authored andcommitted
firmware: qcom_scm: Use TASK_IDLE state in wait_for_wq_completion()
When the kernel issues an SMC (Secure Monitor Call) and the firmware requests the kernel to wait, the waiting thread enters an uninterruptible (D) state. In case of an extended wait request by the firmware, any device suspend request, cannot proceed because of the thread stuck in D state. This blocks the device suspend. Replace wait_for_completion() with wait_for_completion_state(..., TASK_IDLE), so that the waiting thread, show up in TASK_IDLE state, instead of TASK_UNINTERRUPTIBLE (D state). This allows the thread to block until completion, without blocking the device suspend. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Reviewed-by: Bartosz Golaszewski <brgl@kernel.org> Signed-off-by: Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com> Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20251217-multi_waitq_scm-v11-3-f21e50e792b8@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent ccd207e commit 366f05e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/firmware/qcom/qcom_scm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ int qcom_scm_wait_for_wq_completion(u32 wq_ctx)
23062306
if (IS_ERR(wq))
23072307
return PTR_ERR(wq);
23082308

2309-
wait_for_completion(wq);
2309+
wait_for_completion_state(wq, TASK_IDLE);
23102310

23112311
return 0;
23122312
}

0 commit comments

Comments
 (0)