Skip to content

serial: omap: improve performance for RS-485

Philippe Proulx linux-serial lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2serial: omap: improve RS-485 performancedrivers/tty/serial/omap-serial.c+38 -120 replies
2/2serial: omap: fix a few checkpatch warningsdrivers/tty/serial/omap-serial.c+8 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] serial: omap: improve performance for RS-485

The current RS-485 implementation for the OMAP serial driver is to not disable THR interrupts when the driver ring buffer becomes empty until it makes sure the TX shift register is empty, which means the UART is not transmitting anymore and only then can the driver toggle the GPIO output pin for RS-485 data direction.

Since the UART TX FIFO trigger level is set to 32 characters (the comment said 16, but it's really 32), this means there's a burst of IRQs for the transmission time of 33 characters (which means at least 34 ms at 9600 bauds, for example) since the TX FIFO is always below its trigger level and the THR interrupts are not disabled. The driver is essentially polling the status bit using interrupts during this time.

This patchset makes use of the TXEMPTYCTLIT bit of the SCR register instead, which makes it possible to get a THR interrupt only when both the TX FIFO and the TX shift register are empty. We only use this mode if RS-485 is enabled.

This patchset also fixes a few minor coding style warnings from checkpatch.pl.

The patches apply to tty/tty-next.

Philippe Proulx (2):
serial: omap: improve RS-485 performance
serial: omap: fix a few checkpatch warnings

 drivers/tty/serial/omap-serial.c | 67 +++++++++++++++++++++++++++-------------
 1 file changed, 46 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.4.1