Skip to content

Fix 8250 XON/XOFF for DMA-capable devices

Ilpo Järvinen linux-serial lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1serial: 8250: fix XOFF/XON sending when DMA is useddrivers/tty/serial/8250/8250_dma.c drivers/tty/serial/8250/8250_port.c drivers/tty/serial/serial_core.c +1 more+27 -41 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchGilles BulozAndy Shevchenko
1/1T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] Fix 8250 XON/XOFF for DMA-capable devices

DMA-capable 8250 was not properly taking XON/XOFF into account right since it was introduced in 2013. There was no attempt to send x_char out at all which is fixed by this patch.

After making this fix, it was further reported by Gilles Buloz that also rx side fails to work as expected if the receiving side is not reading from tty. I took look into that issue and and determined that XOFF char gets stuck in an intermediate buffer until enough data can be processed in receive_buf(). So it's not very useful from flow control perspective :-). While the problem is more likely to occur with DMA, the code does not look robust and the problem can likely occur also w/o DMA.

I was thinking of fixing the rx side issue by adding lookahead. The most natural place to call lookahead handler would seem to be from flush_to_ldisc() in the case when receive_buf() does not eat all characters that were passed to it. Does anybody have other opinions on how it should be fixed?

Ilpo Järvinen (1):
serial: 8250: fix XOFF/XON sending when DMA is used

 drivers/tty/serial/8250/8250_dma.c  | 11 ++++++++++-
 drivers/tty/serial/8250/8250_port.c |  4 +---
 drivers/tty/serial/serial_core.c    | 14 ++++++++++++++
 include/linux/serial_core.h         |  2 ++
 4 files changed, 27 insertions(+), 4 deletions(-)
Signature · 1 line
2.30.2