lkml.org 
[lkml]   [2004]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UP kernel
    From
    Date
    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;

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:07    [W:5.055 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site