[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210719091535.GG49078@e120937-lin>
Date: Mon, 19 Jul 2021 10:15:35 +0100
From: Cristian Marussi <cristian.marussi@....com>
To: Peter Hilber <peter.hilber@...nsynergy.com>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
virtualization@...ts.linux-foundation.org,
virtio-dev@...ts.oasis-open.org, sudeep.holla@....com,
james.quinlan@...adcom.com, Jonathan.Cameron@...wei.com,
f.fainelli@...il.com, etienne.carriere@...aro.org,
vincent.guittot@...aro.org, souvik.chakravarty@....com,
igor.skalkin@...nsynergy.com, alex.bennee@...aro.org,
jean-philippe@...aro.org, mikhail.golubev@...nsynergy.com,
anton.yakovlev@...nsynergy.com, Vasyl.Vavrychuk@...nsynergy.com,
Andriy.Tryshnivskyy@...nsynergy.com
Subject: Re: [PATCH v6 10/17] firmware: arm_scmi: Make polling mode optional
On Thu, Jul 15, 2021 at 06:36:10PM +0200, Peter Hilber wrote:
> On 12.07.21 16:18, Cristian Marussi wrote:
> > Add a check for the presence of .poll_done transport operation so that
> > transports that do not need to support polling mode have no need to provide
> > a dummy .poll_done callback either and polling mode can be disabled in the
> > SCMI core for that tranport.
> >
> > Signed-off-by: Cristian Marussi <cristian.marussi@....com>
> > ---
> > drivers/firmware/arm_scmi/driver.c | 43 ++++++++++++++++++------------
> > 1 file changed, 26 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> > index a952b6527b8a..4183d25c9289 100644
> > --- a/drivers/firmware/arm_scmi/driver.c
> > +++ b/drivers/firmware/arm_scmi/driver.c
> > @@ -777,25 +777,34 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
> > }
> > if (xfer->hdr.poll_completion) {
> > - ktime_t stop = ktime_add_ns(ktime_get(), SCMI_MAX_POLL_TO_NS);
> > -
> > - spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop));
> > -
> > - if (ktime_before(ktime_get(), stop)) {
> > - unsigned long flags;
> > -
> > - /*
> > - * Do not fetch_response if an out-of-order delayed
> > - * response is being processed.
> > - */
> > - spin_lock_irqsave(&xfer->lock, flags);
> > - if (xfer->state == SCMI_XFER_SENT_OK) {
> > - info->desc->ops->fetch_response(cinfo, xfer);
> > - xfer->state = SCMI_XFER_RESP_OK;
> > + if (info->desc->ops->poll_done) {
> > + ktime_t stop = ktime_add_ns(ktime_get(),
> > + SCMI_MAX_POLL_TO_NS);
> > +
> > + spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer,
> > + stop));
> > +
> > + if (ktime_before(ktime_get(), stop)) {
> > + unsigned long flags;
> > +
> > + /*
> > + * Do not fetch_response if an out-of-order delayed
> > + * response is being processed.
> > + */
> > + spin_lock_irqsave(&xfer->lock, flags);
> > + if (xfer->state == SCMI_XFER_SENT_OK) {
> > + info->desc->ops->fetch_response(cinfo,
> > + xfer);
> > + xfer->state = SCMI_XFER_RESP_OK;
> > + }
> > + spin_unlock_irqrestore(&xfer->lock, flags);
> > + } else {
> > + ret = -ETIMEDOUT;
> > }
> > - spin_unlock_irqrestore(&xfer->lock, flags);
> > } else {
> > - ret = -ETIMEDOUT;
> > + dev_warn_once(dev,
> > + "Polling mode is not supported by transport.\n");
> > + ret = EINVAL;
>
> s/EINVAL/-EINVAL
Ah. Right. I'll fix.
Thanks,
Cristian
Powered by blists - more mailing lists