From: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>,
Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
Subject: [PATCH v9 3/3] firmware: qcom_scm: Use TASK_IDLE state in wait_for_wq_completion()
Date: Sun, 23 Nov 2025 19:49:32 +0530 [thread overview]
Message-ID: <20251123-multi_waitq_scm-v9-3-0080fc259d4d@oss.qualcomm.com> (raw)
In-Reply-To: <20251123-multi_waitq_scm-v9-0-0080fc259d4d@oss.qualcomm.com>
From: Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
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.
Signed-off-by: Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
---
drivers/firmware/qcom/qcom_scm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 149c2ccec2a5ff77054178fa021fd0b721d9f8d7..dfe0410fa9f965b16f8b0a9d98f3046e80b8b97b 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -2320,7 +2320,7 @@ int qcom_scm_wait_for_wq_completion(u32 wq_ctx)
if (IS_ERR(wq))
return PTR_ERR(wq);
- wait_for_completion(wq);
+ wait_for_completion_state(wq, TASK_IDLE);
return 0;
}
--
2.34.1
next prev parent reply other threads:[~2025-11-23 14:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-23 14:19 [PATCH v9 0/3] SCM: Support latest version of waitq-aware firmware Shivendra Pratap
2025-11-23 14:19 ` [PATCH v9 1/3] firmware: qcom_scm: Add API to get waitqueue IRQ info Shivendra Pratap
2025-11-25 6:38 ` Mukesh Ojha
2025-11-23 14:19 ` [PATCH v9 2/3] firmware: qcom_scm: Support multiple waitq contexts Shivendra Pratap
2025-11-25 7:46 ` Mukesh Ojha
2025-11-25 14:19 ` Bartosz Golaszewski
2025-11-23 14:19 ` Shivendra Pratap [this message]
2025-11-25 14:15 ` [PATCH v9 3/3] firmware: qcom_scm: Use TASK_IDLE state in wait_for_wq_completion() Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251123-multi_waitq_scm-v9-3-0080fc259d4d@oss.qualcomm.com \
--to=shivendra.pratap@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=unnathi.chalicheemala@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®