linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: Tim_T_Murphy@Dell.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UP kernel
Date: Fri, 29 Oct 2004 16:08:37 -0500	[thread overview]
Message-ID: <1099084117.3356.7.camel@deimos.microgate.com> (raw)
In-Reply-To: <4B0A1C17AA88F94289B0704CFABEF1AB0B4CC4@ausx2kmps304.aus.amer.dell.com>

On Fri, 2004-10-29 at 14:55, Tim_T_Murphy@Dell.com wrote:
> Oct 29 13:34:48 racjag-1 chat[3886]: expect (CLIENTSERVER)
> Oct 29 13:34:48 racjag-1 kernel: drivers/serial/serial_core.c:102: spin_lock(drivers/serial/serial_core.c:023f2548) already locked by drivers/serial/8250.c/1015
> Oct 29 13:34:48 racjag-1 kernel: drivers/serial/8250.c:1017: spin_unlock(drivers/serial/serial_core.c:023f2548) not locked
> Oct 29 13:34:48 racjag-1 chat[3886]: CLIENTSERVER

One way this can happen is a receive interrupt:

serial8250_interrupt();
    spin_lock(port->lock);
    serial8250_handle_port();
       receive_chars();
          flip.work.func(); /* if FLIP buffer full */
             ldisc->receive_buf(); /* N_TTY */
                 tty->driver->flush_chars();
                     uart_start();
                        spin_lock(port->lock); *BANG*

Try the attached patch and report what happens.

-- 
Paul Fulghum
paulkf@microgate.com

--- linux-2.6.8/drivers/serial/8250.c	2004-08-14 00:36:13.000000000 -0500
+++ b/drivers/serial/8250.c	2004-10-29 15:58:28.076014336 -0500
@@ -830,9 +830,13 @@ 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)
-				return; // if TTY_DONT_FLIP is set
+			/* no room in flip buffer, discard rx FIFO contents to clear IRQ */
+			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;



  parent reply	other threads:[~2004-10-29 21:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-29 19:55 [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UP kernel Tim_T_Murphy
2004-10-29 20:20 ` Russell King
2004-10-29 22:18   ` Paul Fulghum
2004-10-29 23:40   ` Paul Fulghum
2004-10-30 22:43     ` Alan Cox
2004-10-31  0:26       ` Paul Fulghum
2004-11-01  7:14         ` [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UPkernel Stuart MacDonald
2004-11-01 14:10           ` Paul Fulghum
2004-11-01 15:12             ` Stuart MacDonald
2004-11-01 23:02             ` Alan Cox
2004-11-02  0:18               ` Paul Fulghum
2004-10-29 21:08 ` Paul Fulghum [this message]
2004-10-29 21:04 [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UP kernel Tim_T_Murphy
2004-10-29 21:14 ` Russell King
2004-10-29 23:30 Tim_T_Murphy
2004-10-30 16:02 ` Russell King
2004-10-29 23:33 Tim_T_Murphy
2004-11-01 14:28 Tim_T_Murphy
2004-11-01 14:35 ` Russell King
2004-11-01 16:06 Tim_T_Murphy
2005-01-06 14:55 Tim_T_Murphy
2005-01-06 22:47 Tim_T_Murphy
2005-01-06 23:11 ` Alan Cox
2005-01-07  0:43   ` Paul Fulghum
2005-01-07  1:54     ` Alan Cox
2005-01-07 14:04       ` Paul Fulghum
2005-01-06 23:50 Tim_T_Murphy

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=1099084117.3356.7.camel@deimos.microgate.com \
    --to=paulkf@microgate.com \
    --cc=Tim_T_Murphy@Dell.com \
    --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 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).