]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: sccnxp: Reset break and overrun bits in RX handler
authorAlexander Shiyan <shc_work@mail.ru>
Mon, 21 Jan 2013 15:38:56 +0000 (19:38 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2013 21:56:46 +0000 (13:56 -0800)
This patch adds a hardware reset the break and overflow bits for
these events. Without resetting the bits they will be reported to
the core every time, when once occur.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sccnxp.c

index c5f0e964ec058bd85de55b39fdccfc0c03271186..c7dec1678f65721c6b071f9b553850f72d2f3e30 100644 (file)
@@ -305,14 +305,19 @@ static void sccnxp_handle_rx(struct uart_port *port)
                if (unlikely(sr)) {
                        if (sr & SR_BRK) {
                                port->icount.brk++;
+                               sccnxp_port_write(port, SCCNXP_CR_REG,
+                                                 CR_CMD_BREAK_RESET);
                                if (uart_handle_break(port))
                                        continue;
                        } else if (sr & SR_PE)
                                port->icount.parity++;
                        else if (sr & SR_FE)
                                port->icount.frame++;
-                       else if (sr & SR_OVR)
+                       else if (sr & SR_OVR) {
                                port->icount.overrun++;
+                               sccnxp_port_write(port, SCCNXP_CR_REG,
+                                                 CR_CMD_STATUS_RESET);
+                       }
 
                        sr &= port->read_status_mask;
                        if (sr & SR_BRK)