提交 a7209541 编写于 作者: N Narendra Hadke 提交者: Greg Kroah-Hartman

serial: mvebu-uart: uart2 error bits clearing

For mvebu uart2, error bits are not cleared on buffer read.
This causes interrupt loop and system hang.

Cc: stable@vger.kernel.org
Reviewed-by: NYi Guo <yi.guo@cavium.com>
Reviewed-by: NNadav Haklai <nadavh@marvell.com>
Signed-off-by: NNarendra Hadke <nhadke@marvell.com>
Signed-off-by: NPali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20220726091221.12358-1-pali@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 707f816f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册