linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Bordug <vbordug@ru.mvista.com>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH] POWERPC CPM_UART: got rid of extra status checks during RX
Date: Wed, 28 Mar 2007 01:33:17 +0400	[thread overview]
Message-ID: <20070327213317.22598.18315.stgit@localhost.localdomain> (raw)


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

                 reply	other threads:[~2007-03-27 21:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070327213317.22598.18315.stgit@localhost.localdomain \
    --to=vbordug@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).