[PATCH linux dev-4.10 v3 14/31] drivers: fsi: SBEFIFO: check for xfr complete in read wait_event

Andrew Jeffery andrew at aj.id.au
Fri Oct 6 09:50:15 AEDT 2017


On Thu, 2017-10-05 at 14:24 -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>

Reviewed-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 9b560ec..5d73437 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/20171006/4bf42f4c/attachment-0001.sig>


More information about the openbmc mailing list