From: Guru Das Srinagesh <quic_gurus@quicinc.com>
To: Sibi Sankar <quic_sibis@quicinc.com>
Cc: <andersson@kernel.org>, <agross@kernel.org>,
<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <robh+dt@kernel.org>,
<konrad.dybcio@somainline.org>, <robimarko@gmail.com>
Subject: Re: [PATCH V7 2/2] firmware: qcom: scm: Add wait-queue handling logic
Date: Tue, 10 Jan 2023 00:14:11 -0800 [thread overview]
Message-ID: <20230110081410.GB2082@quicinc.com> (raw)
In-Reply-To: <20230110063745.16739-3-quic_sibis@quicinc.com>
On Jan 10 2023 12:07, Sibi Sankar wrote:
...
> +static int __scm_smc_do_quirk_handle_waitq(struct device *dev, struct arm_smccc_args *waitq,
> + struct arm_smccc_res *res)
> +{
> + int ret;
> + struct arm_smccc_args resume;
> + u32 wq_ctx, smc_call_ctx, flags;
> + struct arm_smccc_args *smc = waitq;
> +
> + do {
> + __scm_smc_do_quirk(smc, res);
> +
> + if (res->a0 == QCOM_SCM_WAITQ_SLEEP) {
> + wq_ctx = res->a1;
> + smc_call_ctx = res->a2;
> + flags = res->a3;
> +
> + if (!dev)
> + return -EPROBE_DEFER;
> +
> + ret = qcom_scm_lookup_completion(wq_ctx);
I see that this function has been created in response to Bjorn's comment [1]
about avoiding the dev_get_drvdata() call, but I would prefer to not use this
function as it hides the fact that the wait_for_completion() is occurring here.
Knowing where the waiting is happening is useful not just for understanding
code flow but also for debugging issues in the future.
...
> +static struct completion *qcom_scm_lookup_wq(struct qcom_scm *scm, u32 wq_ctx)
> +{
This function is called qcom_scm_lookup_wq() but there is no looking up
occurring here. Could this comment be added for context?
/* FW currently only supports a single wq_ctx (zero).
* TODO: Update this logic to include dynamic allocation and lookup of
* completion structs when FW supports more wq_ctx values.
*/
> + /* assert wq_ctx is zero */
> + if (wq_ctx != 0) {
> + dev_err(scm->dev, "No waitqueue found for wq_ctx %d\n", wq_ctx);
> + return ERR_PTR(-EINVAL);
> + }
> +
> + return &scm->waitq_comp;
> +}
> +
...
[1] https://lore.kernel.org/lkml/20221208221125.bflo7unhcrgfsgbr@builder.lan/
next prev parent reply other threads:[~2023-01-10 8:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 6:37 [PATCH V7 0/2] SCM: Add support for wait-queue aware firmware Sibi Sankar
2023-01-10 6:37 ` [PATCH V7 1/2] dt-bindings: firmware: qcom,scm: Add optional interrupt Sibi Sankar
2023-01-10 6:37 ` [PATCH V7 2/2] firmware: qcom: scm: Add wait-queue handling logic Sibi Sankar
2023-01-10 8:14 ` Guru Das Srinagesh [this message]
2023-01-10 17:54 ` Bjorn Andersson
2023-01-10 20:04 ` Guru Das Srinagesh
2023-01-10 12:14 ` Srinivas Kandagatla
2023-01-11 9:34 ` Sibi Sankar
2023-01-10 18:07 ` Bjorn Andersson
2023-01-11 9:39 ` Sibi Sankar
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=20230110081410.GB2082@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_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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).