Serial driver hangs

From: Roland Caßebohm (roland.cassebohm_at_VisionSystems.de)
Date: 09/28/04

  • Next message: Denis Vlasenko: "Re: ESP corruption bug - what CPUs are affected?"
    To: linux-kernel@vger.kernel.org
    Date:	Tue, 28 Sep 2004 17:34:38 +0200
    
    

    Hi,

    my platform is uClinux kernel 2.4.24 with an ARM with PCI and
    a 2 port VSCOM 200I PCI card.

    I use the serial driver with very high load. With my
    application sends and receives on two ports with 921600 baud.

    After a while the driver hangs in an endless loop in the
    interrupt routine.
    As I can see, the bit TTY_DONT_FLIP in tty->flags is set, so
    the receive-buffer can't be flipped. In receive_chars() all
    ports are checked for received bytes, but if the buffer is
    full and can't be flipped, no byte are read from the UART and
    the interrupt will never go inactive.

    >>>>>>>>>>>>
        do {
            if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
                tty->flip.tqueue.routine((void *) tty);
                if (tty->flip.count >= TTY_FLIPBUF_SIZE)
                    return; // if TTY_DONT_FLIP is set
            }
            ch = serial_inp(info, UART_RX);
            *tty->flip.char_buf_ptr = ch;
            icount->rx++;
    >>>>>>>>>>>>

    I have tried just to read all byte left in the FIFO of the
    UART in that case and throw them away.

    >>>>>>>>>>>>
                if (tty->flip.count >= TTY_FLIPBUF_SIZE)
                {
                    do {
                        ch = serial_inp(info, UART_RX);
                        icount->overrun++;
                        *status = serial_inp(info, UART_LSR);
                    } while (*status & UART_LSR_DR);
                    return; // if TTY_DONT_FLIP is set
                }
    >>>>>>>>>>>>

    This is working but would probably not the best way, because
    there could be enough place in the other flip buffer. Maybe
    it is possible to disable the receive interrupt of the UART
    till the receive routine read_chan(), which sets
    TTY_DONT_FLIP, releases the buffer.

    Thanks for any help,
    Roland

    -- 
    ___________________________________________________
    VS Vision Systems GmbH, Industrial Image Processing
    Dipl.-Ing. Roland Caßebohm
    Aspelohe 27A, D-22848 Norderstedt, Germany
    http://www.visionsystems.de
    ___________________________________________________
    -
    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/
    

  • Next message: Denis Vlasenko: "Re: ESP corruption bug - what CPUs are affected?"

    Relevant Pages

    • Re: What do I do with an old laptop?
      ... does not have a ethernet adapter on it. ... Add a USB2 or Firewire PCI card, one with two ports. ... as an always-on small server. ...
      (Ubuntu)
    • Re: Trying to fix ITE-887x parallel/serial driver bugs (including unhandled IRQs)
      ... We do need to find and assign suitable ports ... although this should probably be done via the PCI quirks on PCI setup. ... Polling the UART IIR register shows that it ... IRQs generated. ...
      (Linux-Kernel)
    • Re: "Resources" problem with ports
      ... Thanks Steve I really do appreciate your help. ... disabling all the other ports but not uninstalling them...... ... > Sounds like your PCI card is having a motherboard resource problem. ... >> install but wouldn't print. ...
      (microsoft.public.windowsxp.hardware)
    • Re: [BUG][2.6.8.1] serial driver hangs SMP kernel, but not the UP kernel
      ... > serial driver in the list, and tried to see if their solutions solved ... > a service startup script; the script uses setserial to prepare an unused ... Shouldn't 8250_pci setup the ports already for you? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch 2.6.13-git] 8250 tweaks
      ... It's then asked to add two more ports from the serial8250.0 device, ... These come from a platform device in arch/ppc. ... The serial driver is being asked to create _four_ ports. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)