summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Moń <tomasz.mon@camlingroup.com>2022-01-17 07:04:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-26 14:54:02 +0100
commit7a637784d517863e20d0556037aa4758a706a79f (patch)
tree99b7732fef1191a0952828a932eadba7803e807c
parent021d517296f30f5ca077eef9b976dff04841bc9b (diff)
serial: imx: reduce RX interrupt frequency
Triggering RX interrupt for every byte defeats the purpose of aging timer and leads to interrupt storm at high baud rates. The interrupt storm can starve line discipline worker and prevent tty throttling, rendering hardware/software flow control useless. Increase receiver trigger level to 8 to increase the minimum period between RX interrupts to 8 characters time. The tradeoff is increased latency. Aging timer resets with every received character. Worst case scenario happens when RX data intercharacter delay is slightly less than the aging timer timeout (8 characters time). The upper bound of the time a character can wait in RxFIFO before interrupt is raised is: (RXTL - 1) * (8 character time timeout + received 1 character time) Usually the data is received in frames, with low intercharacter delay. In such case the latency increase is 8 characters time at the end of the frame with probability (RXTL - 1) / RXTL. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Tomasz Moń <tomasz.mon@camlingroup.com> Link: https://lore.kernel.org/r/20220117060417.624613-1-tomasz.mon@camlingroup.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index df8a0c8b8b29..d8034f166686 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1258,7 +1258,7 @@ static void imx_uart_clear_rx_errors(struct imx_port *sport)
}
#define TXTL_DEFAULT 2 /* reset default */
-#define RXTL_DEFAULT 1 /* reset default */
+#define RXTL_DEFAULT 8 /* 8 characters or aging timer */
#define TXTL_DMA 8 /* DMA burst setting */
#define RXTL_DMA 9 /* DMA burst setting */