public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com,
	Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com,
	etienne.carriere@linaro.org, Sudeep Holla <sudeep.holla@arm.com>,
	vincent.guittot@linaro.org, souvik.chakravarty@arm.com
Subject: Re: [PATCH v2 1/5] firmware: arm_scmi: reset_rx_to_maxsz during async commands
Date: Wed, 2 Jun 2021 17:08:53 +0100	[thread overview]
Message-ID: <20210602160853.mui3xdr7v4cmmwn2@bogus> (raw)
In-Reply-To: <20210601102421.26581-2-cristian.marussi@arm.com>

On Tue, Jun 01, 2021 at 11:24:17AM +0100, Cristian Marussi wrote:
> During an async commands execution the rx buffer len is at first set to
> max_msg_sz when the synchronous part of the command is first sent; once
> the synchronous part completes the transport layer waits for the delayed
> response which will be processed using the same xfer descriptor initially
> allocated, but synchronous response received at the end of the xfer will
> have shrunk the rx buffer len to the effective payload response length.
> 
> Raise the rx buffer length again to max_msg_sz while waiting for the
> delayed response, while adding an informational error message.
> 
> Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> ---
>  drivers/firmware/arm_scmi/driver.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 66eb3f0e5daf..75141b90ae53 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -513,8 +513,16 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
>  	xfer->async_done = &async_response;
>  
>  	ret = do_xfer(ph, xfer);
> -	if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
> -		ret = -ETIMEDOUT;
> +	if (!ret) {
> +		/* rx.len would have been shrunk in the sync do_xfer above */
> +		reset_rx_to_maxsz(ph, xfer);

Won't this race with delayed response notification ? I think so, let me
know if not and how. Can't we have this before we fetch the response into xfer ?

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-02 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 10:24 [PATCH v2 0/5] Review/Extend SCMI Transport Core layer Cristian Marussi
2021-06-01 10:24 ` [PATCH v2 1/5] firmware: arm_scmi: reset_rx_to_maxsz during async commands Cristian Marussi
2021-06-02 16:08   ` Sudeep Holla [this message]
2021-06-01 10:24 ` [PATCH v2 2/5] firmware: arm_scmi: Add support for type handling in common functions Cristian Marussi
2021-06-01 10:24 ` [PATCH v2 3/5] firmware: arm_scmi: Add transport optional init/exit support Cristian Marussi
2021-06-01 10:24 ` [PATCH v2 4/5] firmware: arm_scmi: Introduce monotonically increasing tokens Cristian Marussi
2021-06-07 17:39   ` Cristian Marussi
2021-06-01 10:24 ` [PATCH v2 5/5] firmware: arm_scmi: Introduce delegated xfers support Cristian Marussi
2021-06-04  8:54 ` (subset) [PATCH v2 0/5] Review/Extend SCMI Transport Core layer Sudeep Holla
2021-06-11 17:06 ` Cristian Marussi

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=20210602160853.mui3xdr7v4cmmwn2@bogus \
    --to=sudeep.holla@arm.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=cristian.marussi@arm.com \
    --cc=etienne.carriere@linaro.org \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=souvik.chakravarty@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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