[PATCH] POWERPC CPM_UART: got rid of extra status checks during RX

Vitaly Bordug vbordug at ru.mvista.com
Wed Mar 28 07:33:17 EST 2007


Status were verified in the cycle while exact variable is not updated in
it. All "possibly bad" bits in status are relevant to the last received
byte from buffer only. Also, more robust handling of overrun case.

Signed-off-by: Vitaly Bordug <vbordug at ru.mvista.com>
---

 drivers/serial/cpm_uart/cpm_uart_core.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 7a3b97f..bbb0b22 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -299,8 +299,8 @@ static void cpm_uart_int_rx(struct uart_port *port)
 			port->icount.rx++;
 			flg = TTY_NORMAL;
 
-			if (status &
-			    (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))
+			if (!i && status &
+				  (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))
 				goto handle_error;
 			if (uart_handle_sysrq_char(port, ch))
 				continue;
@@ -354,14 +354,8 @@ static void cpm_uart_int_rx(struct uart_port *port)
 		flg = TTY_FRAME;
 
 	/* overrun does not affect the current character ! */
-	if (status & BD_SC_OV) {
-		ch = 0;
-		flg = TTY_OVERRUN;
-		/* We skip this buffer */
-		/* CHECK: Is really nothing senseful there */
-		/* ASSUMPTION: it contains nothing valid */
-		i = 0;
-	}
+	if (status & BD_SC_OV)
+		tty_insert_flip_char(tty, 0, TTY_OVERRUN);
 #ifdef SUPPORT_SYSRQ
 	port->sysrq = 0;
 #endif



More information about the Linuxppc-dev mailing list