This is a note to let you know that I've just added the patch titled serial: mvebu-uart: uart2 error bits clearing to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: serial-mvebu-uart-uart2-error-bits-clearing.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 040076f0ab10143dc046c3347c9b3c04d0330d7a Author: Narendra Hadke <nhadke@xxxxxxxxxxx> Date: Tue Jul 26 11:12:21 2022 +0200 serial: mvebu-uart: uart2 error bits clearing [ Upstream commit a7209541239e5dd44d981289e5f9059222d40fd1 ] For mvebu uart2, error bits are not cleared on buffer read. This causes interrupt loop and system hang. Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Yi Guo <yi.guo@xxxxxxxxxx> Reviewed-by: Nadav Haklai <nadavh@xxxxxxxxxxx> Signed-off-by: Narendra Hadke <nhadke@xxxxxxxxxxx> Signed-off-by: Pali Rohár <pali@xxxxxxxxxx> Link: https://lore.kernel.org/r/20220726091221.12358-1-pali@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 93489fe334d0..65eaecd10b7c 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -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);