mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Unnathi Chalicheemala <unnathi.chalicheemala@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,
	kernel@oss.qualcomm.com,
	Prasad Sodagudi <prasad.sodagudi@oss.qualcomm.com>,
	Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
	Trilok Soni <quic_tsoni@quicinc.com>,
	Unnathi Chalicheemala <unnathi.chalicheemala@oss.qualcomm.com>
Subject: [PATCH v6 3/3] firmware: qcom_scm: Check for waitq state in wait_for_wq_completion()
Date: Fri, 25 Apr 2025 16:48:03 -0700	[thread overview]
Message-ID: <20250425-multi_waitq_scm-v6-3-cba8ca5a6d03@oss.qualcomm.com> (raw)
In-Reply-To: <20250425-multi_waitq_scm-v6-0-cba8ca5a6d03@oss.qualcomm.com>

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


      parent reply	other threads:[~2025-04-25 23:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 23:48 [PATCH v6 0/3] SCM: Support latest version of waitq-aware firmware Unnathi Chalicheemala
2025-04-25 23:48 ` [PATCH v6 1/3] firmware: qcom_scm: Add API to get waitqueue IRQ info Unnathi Chalicheemala
2025-04-25 23:48 ` [PATCH v6 2/3] firmware: qcom_scm: Support multiple waitq contexts Unnathi Chalicheemala
2025-05-09  9:48   ` Pavan Kondeti
2025-05-21 23:24     ` Unnathi Chalicheemala
2025-04-25 23:48 ` Unnathi Chalicheemala [this message]

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=20250425-multi_waitq_scm-v6-3-cba8ca5a6d03@oss.qualcomm.com \
    --to=unnathi.chalicheemala@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=kernel@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasad.sodagudi@oss.qualcomm.com \
    --cc=quic_satyap@quicinc.com \
    --cc=quic_tsoni@quicinc.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®