* [PATCH] POWERPC CPM_UART: got rid of extra status checks during RX
@ 2007-03-27 21:33 Vitaly Bordug
0 siblings, 0 replies; only message in thread
From: Vitaly Bordug @ 2007-03-27 21:33 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
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@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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-27 21:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27 21:33 [PATCH] POWERPC CPM_UART: got rid of extra status checks during RX Vitaly Bordug
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).