[PATCH linux dev-4.10 v2 3/9] drivers: fsi: SBEFIFO: check for xfr complete in read wait_event

Andrew Jeffery andrew at aj.id.au
Thu Oct 5 11:35:14 AEDT 2017


On Fri, 2017-09-29 at 17:41 -0500, Eddie James wrote:
> From: "Edward A. James" <eajames at us.ibm.com>
> 
> We should check to see if the XFR is complete, not just for a failure
> or for available data. If we hit EOT without getting more data, we may
> wait forever.
> 
> Signed-off-by: Edward A. James <eajames at us.ibm.com>

Acked-by: Andrew Jeffery <andrew at aj.id.au>

> ---
>  drivers/fsi/fsi-sbefifo.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
> index fa34bd8..a9fc8e9 100644
> --- a/drivers/fsi/fsi-sbefifo.c
> +++ b/drivers/fsi/fsi-sbefifo.c
> @@ -541,10 +541,15 @@ static bool sbefifo_read_ready(struct sbefifo *sbefifo,
>  			       struct sbefifo_client *client, size_t *n,
>  			       size_t *ret)
>  {
> +	struct sbefifo_xfr *xfr = list_first_entry_or_null(&client->xfrs,
> +							   struct sbefifo_xfr,
> +							   client);
> +
>  	*n = sbefifo_buf_nbreadable(&client->rbuf);
>  	*ret = READ_ONCE(sbefifo->rc);
>  
> -	return *ret || *n;
> +	return *ret || *n ||
> +		(xfr && test_bit(SBEFIFO_XFR_COMPLETE, &xfr->flags));
>  }
>  
>  static ssize_t sbefifo_read_common(struct sbefifo_client *client,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20171005/10a6fd97/attachment.sig>


More information about the openbmc mailing list