All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] 8250 receive lockup fix
Date: Fri, 08 Oct 2004 16:02:52 -0500	[thread overview]
Message-ID: <1097269371.2647.2.camel@deimos.microgate.com> (raw)

Fix lockup caused by 8520 serial driver not clearing
receive interrupt if flip buffer becomes full.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>


--- linux-2.6.9-rc3-mm3/drivers/serial/8250.c	2004-10-08 15:51:04.000000000 -0500
+++ bluedillo/drivers/serial/8250.c	2004-10-08 15:51:44.000000000 -0500
@@ -872,8 +872,19 @@ receive_chars(struct uart_8250_port *up,
 	do {
 		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
 			tty->flip.work.func((void *)tty);
-			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
+			if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+				/* no room in flip buffer, discard rx FIFO contents to clear IRQ
+				 * *FIXME* Hardware with auto flow control
+				 * would benefit from leaving the data in the FIFO and
+				 * disabling the rx IRQ until space becomes available.
+				 */
+				do {
+					serial_inp(up, UART_RX);
+					up->port.icount.overrun++;
+					*status = serial_inp(up, UART_LSR);
+				} while ((*status & UART_LSR_DR) && (max_count-- > 0));
 				return;	/* if TTY_DONT_FLIP is set */
+			}
 		}
 		ch = serial_inp(up, UART_RX);
 		*tty->flip.char_buf_ptr = ch;



                 reply	other threads:[~2004-10-08 21:03 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=1097269371.2647.2.camel@deimos.microgate.com \
    --to=paulkf@microgate.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.