[PATCH v6 3/3] firmware: qcom_scm: Check for waitq state in wait_for_wq_completion()

Unnathi Chalicheemala posted 3 patches 9 months, 2 weeks ago
There is a newer version of this series
[PATCH v6 3/3] firmware: qcom_scm: Check for waitq state in wait_for_wq_completion()
Posted by Unnathi Chalicheemala 9 months, 2 weeks ago
Modify wait_for_wq_completion() to check if task is in idle state using
wait_for_completion_state().

This allows for detecting when waitq contexts are in idle state and
propagates it to __scm_smc_do(), which is beneficial when task is idle
and waiting for a kick to accept new requests.

Signed-off-by: Unnathi Chalicheemala <unnathi.chalicheemala@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 9f8db13ef1ce14cc324fa9f0abf5c6a97ceb7b8b..a03c18fadd9c6ca6ab5fcd5e386834dcc3663eb8 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -2192,7 +2192,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