All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-4.13 0/2] Fix SBEFIFO chardev read behaviour
@ 2018-05-14  6:18 Andrew Jeffery
  2018-05-14  6:18 ` [PATCH linux dev-4.13 1/2] fsi: sbefifo: Unpack !sbefifo_xfr_rsp_pending(client) test Andrew Jeffery
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andrew Jeffery @ 2018-05-14  6:18 UTC (permalink / raw)
  To: joel; +Cc: Andrew Jeffery, eajames.ibm, benh, openbmc

Hello,

read() on the SBEFIFO chardevs is currently unusuable as it will always return
-EAGAIN on a read subsequent to the EOT flag being observed. This breaks reads
using short buffers as we now have no way to know when we have received the
entire message. This is made infinitely worse by the protocol, which as
defined, means we cannot know how much data must be read, and therefore all
buffers are effectively short*.

These two patches help by at least returning 0 for a read subsequent to one
which drains the last byte from the transfer buffer. A read subsequent to one
returning 0 will then return -EAGAIN if necessary, under the expectation that a
write() has been issued.

This is a work-around until BenH gets his alternative SBEFIFO implementation in
shape.

* This is true to a point - it recently came to light that we can expect any
  FFDC to be at a maximum 8K in size, and the maximum size of the transfer is
  defined as:

  * The requested response size, plus
  * The status "header", plus
  * Up to 8K of FFDC

Andrew Jeffery (2):
  fsi: sbefifo: Unpack !sbefifo_xfr_rsp_pending(client) test
  fsi: sbefifo: Return 0 on read() to indicate end of response

 drivers/fsi/fsi-sbefifo.c | 48 +++++++++++++++++++++++++++++++--------
 1 file changed, 38 insertions(+), 10 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-15 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14  6:18 [PATCH linux dev-4.13 0/2] Fix SBEFIFO chardev read behaviour Andrew Jeffery
2018-05-14  6:18 ` [PATCH linux dev-4.13 1/2] fsi: sbefifo: Unpack !sbefifo_xfr_rsp_pending(client) test Andrew Jeffery
2018-05-14  6:18 ` [PATCH linux dev-4.13 2/2] fsi: sbefifo: Return 0 on read() to indicate end of response Andrew Jeffery
2018-05-14 22:27 ` [PATCH linux dev-4.13 0/2] Fix SBEFIFO chardev read behaviour Eddie James
2018-05-14 23:09   ` Andrew Jeffery
2018-05-15 13:50     ` Eddie James

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.