]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
firmware: qcom_scm: Use TASK_IDLE state in wait_for_wq_completion()
authorUnnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
Wed, 17 Dec 2025 14:34:21 +0000 (20:04 +0530)
committerBjorn Andersson <andersson@kernel.org>
Sat, 3 Jan 2026 17:57:16 +0000 (11:57 -0600)
commit366f05e348b2ba454869ba7148ace6f25f229540
tree4af9350456b524116abb7ddbbc3210afb0faab85
parentccd207ec848e768da41465352a0f52081eec6bb1
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>
drivers/firmware/qcom/qcom_scm.c