FAILED: patch "[PATCH] serial: mvebu-uart: uart2 error bits clearing" failed to apply to 4.9-stable tree
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a7209541239e5dd44d981289e5f9059222d40fd1 Mon Sep 17 00:00:00 2001
From: Narendra Hadke <[email protected]>
Date: Tue, 26 Jul 2022 11:12:21 +0200
Subject: [PATCH] serial: mvebu-uart: uart2 error bits clearing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For mvebu uart2, error bits are not cleared on buffer read. This causes interrupt loop and system hang.
Reviewed-by Yi Guo <[email protected]>
Reviewed-by Nadav Haklai <[email protected]>
Signed-off-by Narendra Hadke <[email protected]>
Signed-off-by Pali Rohár <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
drivers/tty/serial/mvebu-uart.c +11 -0
@@ -265,6 +265,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status)struct tty_port *tport = &port->state->port;unsigned char ch =0 ;char flag =0 ; +int ret; do { if (status & STAT_RX_RDY(port)) {
@@ -277,6 +278,16 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) port->icount.parity++; } +/* +* For UART2, error bits are not cleared on buffer read. +* This causes interrupt loop and system hang. +*/ +if (IS_EXTENDED (port) && (status &STAT_BRK_ERR )) { + ret =readl (port->membase +UART_STAT ); + ret |=STAT_BRK_ERR ; +writel (ret, port->membase +UART_STAT ); + } +if (status &STAT_BRK_DET ) { port->icount.brk++; status &= ~(STAT_FRM_ERR |STAT_PAR_ERR );