mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Unnathi Chalicheemala <quic_uchalich@quicinc.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Sibi Sankar <quic_sibis@quicinc.com>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<kernel@quicinc.com>, Prasad Sodagudi <quic_psdoagud@quicinc.com>,
	"Murali Nalajala" <quic_mnalajal@quicinc.com>,
	Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
	Unnathi Chalicheemala <quic_uchalich@quicinc.com>
Subject: [PATCH 1/3] firmware: qcom-scm: Initialize waitq before setting global __scm
Date: Wed, 28 Feb 2024 10:49:59 -0800	[thread overview]
Message-ID: <20240228-multi_waitq-v1-1-ccb096419af0@quicinc.com> (raw)
In-Reply-To: <20240228-multi_waitq-v1-0-ccb096419af0@quicinc.com>

Suppose there's another device probing at the same time as SCM driver.
It calls into SCM and triggers WAITQ sleep but waitq completion
structure may not be initialized yet.
Fix this by moving initialization of waitq before setting global __scm.

Fixes: 6bf325992236 ("firmware: qcom: scm: Add wait-queue handling logic")
Signed-off-by: Unnathi Chalicheemala <quic_uchalich@quicinc.com>
---
 drivers/firmware/qcom/qcom_scm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 520de9b5633a..c1be8270ead1 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -1854,11 +1854,11 @@ static int qcom_scm_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	init_completion(&scm->waitq_comp);
+
 	__scm = scm;
 	__scm->dev = &pdev->dev;
 
-	init_completion(&__scm->waitq_comp);
-
 	irq = platform_get_irq_optional(pdev, 0);
 	if (irq < 0) {
 		if (irq != -ENXIO)

-- 
2.25.1


  reply	other threads:[~2024-02-28 18:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 18:49 [PATCH 0/3] SCM: Support latest version of waitq-aware firmware Unnathi Chalicheemala
2024-02-28 18:49 ` Unnathi Chalicheemala [this message]
2024-03-05 19:11   ` [PATCH 1/3] firmware: qcom-scm: Initialize waitq before setting global __scm Bartosz Golaszewski
2024-02-28 18:50 ` [PATCH 2/3] firmware: qcom-scm: Support multiple waitq contexts Unnathi Chalicheemala
2024-02-28 23:20   ` Chris Lew
2024-03-06 18:14     ` Unnathi Chalicheemala
2024-03-05 22:28   ` Bjorn Andersson
2024-03-06 21:37     ` Unnathi Chalicheemala
2024-02-28 18:50 ` [PATCH 3/3] firmware: qcom-scm: Remove QCOM_SMC_WAITQ_FLAG_WAKE_ALL Unnathi Chalicheemala
2024-03-05 21:13   ` Konrad Dybcio

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=20240228-multi_waitq-v1-1-ccb096419af0@quicinc.com \
    --to=quic_uchalich@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=kernel@quicinc.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_mnalajal@quicinc.com \
    --cc=quic_psdoagud@quicinc.com \
    --cc=quic_satyap@quicinc.com \
    --cc=quic_sibis@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®