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

Unnathi Chalicheemala posted 3 patches 6 months, 4 weeks ago
There is a newer version of this series
[PATCH v7 3/3] firmware: qcom_scm: Check for waitq state in wait_for_wq_completion()
Posted by Unnathi Chalicheemala 6 months, 4 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 c2682e9bde58b6f132af0c1bc2e194db0e401e3b..b8ce02099584c4a87095cdc2dd688cd28bd2dae3 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -2189,7 +2189,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