From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: Will Deacon <will.deacon@arm.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
robh+dt <robh+dt@kernel.org>,
David Brown <david.brown@linaro.org>,
"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
Joerg Roedel <joro@8bytes.org>,"
<iommu@lists.linux-foundation.org>,
Andy Gross <agross@kernel.org>,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH v3 1/4] firmware: qcom_scm-64: Add atomic version of qcom_scm_call
Date: Mon, 5 Aug 2019 15:27:55 -0700 [thread overview]
Message-ID: <20190805222755.GB2634@builder> (raw)
In-Reply-To: <CAFp+6iEwN6jeEGNxKVU5_i5NxdEbuF2ZggegEJZ1Rq6F=H34jg@mail.gmail.com>
On Wed 19 Jun 04:34 PDT 2019, Vivek Gautam wrote:
> On Tue, Jun 18, 2019 at 11:25 PM Will Deacon <will.deacon@arm.com> wrote:
> >
> > On Wed, Jun 12, 2019 at 12:45:51PM +0530, Vivek Gautam wrote:
> > > There are scnenarios where drivers are required to make a
> > > scm call in atomic context, such as in one of the qcom's
> > > arm-smmu-500 errata [1].
> > >
> > > [1] ("https://source.codeaurora.org/quic/la/kernel/msm-4.9/commit/
> > > drivers/iommu/arm-smmu.c?h=CogSystems-msm-49/
> > > msm-4.9&id=da765c6c75266b38191b38ef086274943f353ea7")
> > >
> > > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > > Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > ---
> > > drivers/firmware/qcom_scm-64.c | 136 ++++++++++++++++++++++++++++-------------
> > > 1 file changed, 92 insertions(+), 44 deletions(-)
> > >
> > > diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
> > > index 91d5ad7cf58b..b6dca32c5ac4 100644
> > > --- a/drivers/firmware/qcom_scm-64.c
> > > +++ b/drivers/firmware/qcom_scm-64.c
>
> [snip]
>
> > > +
> > > +static void qcom_scm_call_do(const struct qcom_scm_desc *desc,
> > > + struct arm_smccc_res *res, u32 fn_id,
> > > + u64 x5, bool atomic)
> > > +{
> >
> > Maybe pass in the call type (ARM_SMCCC_FAST_CALL vs ARM_SMCCC_STD_CALL)
> > instead of "bool atomic"? Would certainly make the callsites easier to
> > understand.
>
> Sure, will do that.
>
> >
> > > + int retry_count = 0;
> > > +
> > > + if (!atomic) {
> > > + do {
> > > + mutex_lock(&qcom_scm_lock);
> > > +
> > > + __qcom_scm_call_do(desc, res, fn_id, x5,
> > > + ARM_SMCCC_STD_CALL);
> > > +
> > > + mutex_unlock(&qcom_scm_lock);
> > > +
> > > + if (res->a0 == QCOM_SCM_V2_EBUSY) {
> > > + if (retry_count++ > QCOM_SCM_EBUSY_MAX_RETRY)
> > > + break;
> > > + msleep(QCOM_SCM_EBUSY_WAIT_MS);
> > > + }
> > > + } while (res->a0 == QCOM_SCM_V2_EBUSY);
> > > + } else {
> > > + __qcom_scm_call_do(desc, res, fn_id, x5, ARM_SMCCC_FAST_CALL);
> > > + }
> >
> > Is it safe to make concurrent FAST calls?
>
> I better add a spinlock here.
>
Hi Vivek,
Would you be able to respin this patch, so that we could unblock the
introduction of the display nodes in the various device?
Regards,
Bjorn
next prev parent reply other threads:[~2019-08-05 22:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 7:15 [PATCH v3 0/4] Qcom smmu-500 wait-for-safe handling for sdm845 Vivek Gautam
2019-06-12 7:15 ` [PATCH v3 1/4] firmware: qcom_scm-64: Add atomic version of qcom_scm_call Vivek Gautam
2019-06-18 17:55 ` Will Deacon
2019-06-19 11:34 ` Vivek Gautam
2019-08-05 22:27 ` Bjorn Andersson [this message]
2019-08-08 11:35 ` Vivek Gautam
2019-08-08 16:30 ` Will Deacon
2019-06-12 7:15 ` [PATCH v3 2/4] firmware/qcom_scm: Add scm call to handle smmu errata Vivek Gautam
2019-06-12 7:15 ` [PATCH v3 3/4] iommu/arm-smmu: Add support to handle Qcom's wait-for-safe logic Vivek Gautam
2019-06-14 4:05 ` Bjorn Andersson
2019-06-14 9:18 ` Vivek Gautam
2019-06-18 17:52 ` Will Deacon
2019-06-24 10:28 ` Vivek Gautam
2019-06-24 17:03 ` Will Deacon
2019-06-25 7:04 ` Vivek Gautam
2019-06-25 13:39 ` Will Deacon
2019-06-26 6:33 ` Vivek Gautam
2019-06-26 14:48 ` Will Deacon
2019-06-27 7:05 ` Vivek Gautam
2019-06-14 13:15 ` Marc Gonzalez
2019-06-17 9:50 ` Vivek Gautam
2019-06-17 10:48 ` Marc Gonzalez
2019-06-12 7:15 ` [PATCH v3 4/4] arm64: dts/sdm845: Enable FW implemented safe sequence handler on MTP Vivek Gautam
2019-06-14 4:06 ` Bjorn Andersson
2019-06-14 9:01 ` Vivek Gautam
2019-08-05 22:26 ` Bjorn Andersson
2019-08-11 16:08 ` Vivek Gautam
2019-08-11 19:01 ` Bjorn Andersson
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=20190805222755.GB2634@builder \
--to=bjorn.andersson@linaro.org \
--cc=agross@kernel.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=vivek.gautam@codeaurora.org \
--cc=will.deacon@arm.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).