From: Guru Das Srinagesh <quic_gurus@quicinc.com>
To: Sibi Sankar <quic_sibis@quicinc.com>
Cc: <andersson@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
<robh+dt@kernel.org>, <agross@kernel.org>,
<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <konrad.dybcio@somainline.org>,
<robimarko@gmail.com>, <quic_rjendra@quicinc.com>
Subject: Re: [PATCH V4 2/2] firmware: qcom: scm: Add wait-queue handling logic
Date: Mon, 14 Nov 2022 21:33:36 -0800 [thread overview]
Message-ID: <20221115053336.GA29781@quicinc.com> (raw)
In-Reply-To: <20221114082644.28739-3-quic_sibis@quicinc.com>
On Nov 14 2022 13:56, Sibi Sankar wrote:
(snip)
> +static irqreturn_t qcom_scm_irq_handler(int irq, void *data)
> +{
> + int ret;
> + struct qcom_scm *scm = data;
> + struct completion *wq_to_wake;
> + u32 wq_ctx, flags, more_pending = 0;
> +
> + do {
> + ret = scm_get_wq_ctx(&wq_ctx, &flags, &more_pending);
> + if (ret) {
> + dev_err(scm->dev, "GET_WQ_CTX SMC call failed: %d\n", ret);
> + goto out;
> + }
> +
> + wq_to_wake = qcom_scm_lookup_wq(scm, wq_ctx);
> + if (IS_ERR_OR_NULL(wq_to_wake)) {
> + dev_err(scm->dev, "No waitqueue found for wq_ctx %d: %ld\n",
> + wq_ctx, PTR_ERR(wq_to_wake));
> + goto out;
> + }
> +
> + if (flags != QCOM_SMC_WAITQ_FLAG_WAKE_ONE &&
> + flags != QCOM_SMC_WAITQ_FLAG_WAKE_ALL) {
> + dev_err(scm->dev, "Invalid Flags found for wq_ctx: %u\n", flags);
> + goto out;
> + }
> +
> + complete(wq_to_wake);
Need to call complete() or complete_all() based on the flags.
> + } while (more_pending);
> +
> +out:
> + return IRQ_HANDLED;
> +}
next prev parent reply other threads:[~2022-11-15 5:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 8:26 [PATCH V4 0/2] SCM: Add support for wait-queue aware firmware Sibi Sankar
2022-11-14 8:26 ` [PATCH V4 1/2] dt-bindings: firmware: qcom-scm: Add optional interrupt Sibi Sankar
2022-11-14 9:42 ` Krzysztof Kozlowski
2022-11-14 8:26 ` [PATCH V4 2/2] firmware: qcom: scm: Add wait-queue handling logic Sibi Sankar
2022-11-15 5:33 ` Guru Das Srinagesh [this message]
2022-11-16 6:41 ` Sibi Sankar
2022-11-16 22:55 ` Guru Das Srinagesh
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=20221115053336.GA29781@quicinc.com \
--to=quic_gurus@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@somainline.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_rjendra@quicinc.com \
--cc=quic_sibis@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=robimarko@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.