All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eddie James <eajames@linux.vnet.ibm.com>
To: openbmc@lists.ozlabs.org
Cc: joel@jms.id.au, andrew@aj.id.au, "Edward A. James" <eajames@us.ibm.com>
Subject: [PATCH linux dev-4.10 v2 3/9] drivers: fsi: SBEFIFO: check for xfr complete in read wait_event
Date: Fri, 29 Sep 2017 17:41:02 -0500	[thread overview]
Message-ID: <1506724868-13010-4-git-send-email-eajames@linux.vnet.ibm.com> (raw)
In-Reply-To: <1506724868-13010-1-git-send-email-eajames@linux.vnet.ibm.com>

From: "Edward A. James" <eajames@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@us.ibm.com>
---
 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,
-- 
1.8.3.1

  parent reply	other threads:[~2017-09-29 22:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 22:40 [PATCH linux dev-4.10 v2 0/9] drivers: fsi: client fixes and refactor Eddie James
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 1/9] drivers: fsi: SBEFIFO: General clean-up Eddie James
2017-10-04 23:59   ` Andrew Jeffery
2017-10-05 15:11     ` Eddie James
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 2/9] drivers: fsi: SBEFIFO: Fix probe() and remove() Eddie James
2017-10-05  0:32   ` Andrew Jeffery
2017-10-05 15:15     ` Eddie James
2017-10-05 17:37       ` Eddie James
2017-09-29 22:41 ` Eddie James [this message]
2017-10-05  0:35   ` [PATCH linux dev-4.10 v2 3/9] drivers: fsi: SBEFIFO: check for xfr complete in read wait_event Andrew Jeffery
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 4/9] drivers: fsi: occ: General clean-up Eddie James
2017-10-05  0:37   ` Andrew Jeffery
2017-10-05 15:27     ` Eddie James
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 5/9] drivers: fsi: occ: Poll while receiving "command in progress" Eddie James
2017-10-05  1:01   ` Andrew Jeffery
2017-10-05 15:38     ` Eddie James
2017-10-05 23:24       ` Andrew Jeffery
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 6/9] drivers: fsi: occ: Add cancel to remove() and fix probe() Eddie James
2017-10-05  1:07   ` Andrew Jeffery
2017-10-05 16:02     ` Eddie James
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 7/9] drivers: fsi: occ: Fix client memory management Eddie James
2017-10-05  1:12   ` Andrew Jeffery
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 8/9] drivers/hwmon/occ: Remove repeated ops for OCC command in progress Eddie James
2017-10-05  1:13   ` Andrew Jeffery
2017-09-29 22:41 ` [PATCH linux dev-4.10 v2 9/9] drivers: hwmon: occ: Cancel occ operations in remove() Eddie James
2017-10-05  1:20   ` Andrew Jeffery
2017-10-05 16:38     ` Eddie James

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=1506724868-13010-4-git-send-email-eajames@linux.vnet.ibm.com \
    --to=eajames@linux.vnet.ibm.com \
    --cc=andrew@aj.id.au \
    --cc=eajames@us.ibm.com \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.