Commit a4ed06ad authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Linus Torvalds
Browse files

[PATCH] amba-pl010: clear error flags on rx error

The pl010 primecell documentation specifies that an error indicated via RSR
should be cleared by a write to ECR.  We didn't do this, which was causing
errors to be re-reported on every call to pl010_rx_chars().

Doing a write to ECR once we detect an error appears to prevent the ep93xx
console UART driver from going into a mode where it reports "ttyAM0: X
input overrun(s)" every couple of keystrokes.
Signed-off-by: default avatarLennert Buytenhek <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 9468f687
...@@ -129,6 +129,8 @@ static void pl010_rx_chars(struct uart_port *port) ...@@ -129,6 +129,8 @@ static void pl010_rx_chars(struct uart_port *port)
*/ */
rsr = readb(port->membase + UART01x_RSR) | UART_DUMMY_RSR_RX; rsr = readb(port->membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
if (unlikely(rsr & UART01x_RSR_ANY)) { if (unlikely(rsr & UART01x_RSR_ANY)) {
writel(0, port->membase + UART01x_ECR);
if (rsr & UART01x_RSR_BE) { if (rsr & UART01x_RSR_BE) {
rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
port->icount.brk++; port->icount.brk++;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment