linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] serdev: make serdev_device_write() more usable
@ 2018-11-14 15:09 Johan Hovold
  2018-11-14 15:09 ` [PATCH 1/4] serdev: use zero to indicate infinite write timeout Johan Hovold
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Johan Hovold @ 2018-11-14 15:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Greg Kroah-Hartman, Jiri Slaby, Johan Hovold, Andrey Smirnov,
	linux-serial, linux-kernel

This series make the synchronous serdev_device_write() helper more
usable by 

	1) allowing drivers to pass a zero timeout to indicate that they
	   want to wait forever;

	2) returning the number of bytes actually written (buffered)
	   if the helper is interrupted;

	3) make the helper use interruptible wait so that the helper can
	   be used on behalf of user space.

Finally, the two write functions are documented using kernel-doc.

Turns out I was using the wrong timeout for two gnss drivers that
expected the helper to wait indefinitely. I've fixed up those separately
(by using MAX_SCHEDULE_TIMEOUT for now), but for the helper to be usable
when using flow control we really want it to be interruptible.

Besides the two gnss drivers, there's currently only one other in-kernel
user of this helper and that driver (rave-sp) uses a non-zero timeout
and doesn't check the return value and therefore does not need to be
updated.

Note that this series depends on the two above mentioned GNSS fixes
(submitted for v4.20-rc3).

Johan


Johan Hovold (4):
  serdev: use zero to indicate infinite write timeout
  serdev: make synchronous write return bytes written
  serdev: make synchronous write helper interruptible
  serdev: document the write functions using kernel-doc

 drivers/gnss/serial.c     |  2 +-
 drivers/gnss/sirf.c       |  2 +-
 drivers/tty/serdev/core.c | 70 +++++++++++++++++++++++++++++++++++----
 include/linux/serdev.h    |  2 +-
 4 files changed, 66 insertions(+), 10 deletions(-)

-- 
2.19.1


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

end of thread, other threads:[~2018-11-20 17:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 15:09 [PATCH 0/4] serdev: make serdev_device_write() more usable Johan Hovold
2018-11-14 15:09 ` [PATCH 1/4] serdev: use zero to indicate infinite write timeout Johan Hovold
2018-11-14 15:09 ` [PATCH 2/4] serdev: make synchronous write return bytes written Johan Hovold
2018-11-19 15:15   ` Rob Herring
2018-11-20 17:09     ` Johan Hovold
2018-11-14 15:09 ` [PATCH 3/4] serdev: make synchronous write helper interruptible Johan Hovold
2018-11-14 15:09 ` [PATCH 4/4] serdev: document the write functions using kernel-doc Johan Hovold
2018-11-19 15:16 ` [PATCH 0/4] serdev: make serdev_device_write() more usable Rob Herring
2018-11-20 17:11   ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).