Skip to content

serial: imx: work-around for hardware RX flood, and then isr improvements

Sergey Organov linux-arm-kernel linux-serial 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/27 patches 0 repliesNew
  2. v1 posting 1/27 patches 4 repliesSuperseded

Changes in v1 from the cover letter

* Missing braces fixed.

* Withdrawn patch optimizing imx_uart_readl() -> readl(), on request of Uwe Kleine-König.

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7serial: imx: factor-out common code to imx_uart_soft_reset()drivers/tty/serial/imx.c+37 -360 replies
2/7serial: imx: work-around for hardware RX flooddrivers/tty/serial/imx.c+95 -280 replies
3/7serial: imx: do not sysrq broken charsdrivers/tty/serial/imx.c+2 -30 replies
4/7serial: imx: do not break from FIFO reading loop prematurelydrivers/tty/serial/imx.c+3 -70 replies
5/7serial: imx: remove redundant USR2 read from FIFO reading loopdrivers/tty/serial/imx.c+0 -10 replies
6/7serial: imx: stop using USR2 in FIFO reading loopdrivers/tty/serial/imx.c+6 -120 replies
7/7serial: imx: refine local variables in rxint()drivers/tty/serial/imx.c+2 -30 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH v1 RESEND 0/7] serial: imx: work-around for hardware RX flood, and then isr improvements

These series contain a work-around for hardware RX flood in first 2 commits, and then further cleanups and optimizations of the receive IRQ handler.

WARNING: the flood fix is extensively tested with older version of the kernel with DMA turned off. The DMA path is tested only a bit, as DMA has receive problems on my kernel version.

Changes in v1:

* Missing braces fixed.

* Withdrawn patch optimizing imx_uart_readl() -> readl(), on request of Uwe Kleine-König.

Sergey Organov (7):
serial: imx: factor-out common code to imx_uart_soft_reset()
serial: imx: work-around for hardware RX flood
serial: imx: do not sysrq broken chars
serial: imx: do not break from FIFO reading loop prematurely
serial: imx: remove redundant USR2 read from FIFO reading loop
serial: imx: stop using USR2 in FIFO reading loop
serial: imx: refine local variables in rxint()

 drivers/tty/serial/imx.c | 225 ++++++++++++++++++++++++---------------
 1 file changed, 140 insertions(+), 85 deletions(-)

Interdiff against v0:

drivers/tty/serial/imx.c +4 -4
index 45327ff6dd14..447b9060d9df 100644
@@ -889,14 +889,15 @@
 {
 	struct imx_port *sport = dev_id;
 	struct tty_port *port = &sport->port.state->port;
+	typeof(sport->port.membase) membase = sport->port.membase;
 	u32 usr2, rx;
 
 	/* If we received something, check for 0xff flood */
-	usr2 = imx_uart_readl(sport, USR2);
+	usr2 = readl(membase + USR2);
 	if (usr2 & USR2_RDR)
 		imx_uart_check_flood(sport, usr2);
 
-	while ((rx = imx_uart_readl(sport, URXD0)) & URXD_CHARRDY) {
+	while ((rx = readl(membase + URXD0)) & URXD_CHARRDY) {
 		unsigned int flg = TTY_NORMAL;
 		sport->port.icount.rx++;
 
@@ -928,9 +929,8 @@
 				flg = TTY_OVERRUN;
 
 			sport->port.sysrq = 0;
-		} else if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx)) {
+		} else if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
 			continue;
-		}
 
 		if (sport->port.ignore_status_mask & URXD_DUMMY_READ)
 			continue;

+-
2.30.1