On Wed, Sep 16, 2009 at 05:44:58PM +0200, Johan Hovold wrote: > On Wed, Sep 16, 2009 at 04:26:40PM +0100, Alan Cox wrote: > > > Is this changed semantics for port count correct, or should drivers > > > still be able to use port count to determine when to stop reading? > > It is correct. Probably what they want to be doing now is checking the > > ASYNCB_INITIALIZED flag to know if the port is "live" > I tried that for ftdi_sio last night and it seems to work fine. If anyone wants to try it out: diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 4f883b1..7eaea14 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2033,7 +2033,7 @@ static void ftdi_read_bulk_callback(struct urb *urb) dbg("%s - port %d", __func__, port->number); - if (port->port.count <= 0) + if (!test_bit(ASYNCB_INITIALIZED, &port->port.flags)) return; tty = tty_port_tty_get(&port->port); @@ -2089,7 +2089,7 @@ static void ftdi_process_read(struct work_struct *work) dbg("%s - port %d", __func__, port->number); - if (port->port.count <= 0) + if (!test_bit(ASYNCB_INITIALIZED, &port->port.flags)) return; tty = tty_port_tty_get(&port->port); @@ -2247,7 +2247,7 @@ static void ftdi_process_read(struct work_struct *work) } spin_unlock_irqrestore(&priv->rx_lock, flags); /* if the port is closed stop trying to read */ - if (port->port.count > 0) + if (test_bit(ASYNCB_INITIALIZED, &port->port.flags)) /* delay processing of remainder */ schedule_delayed_work(&priv->rx_work, 1); else @@ -2259,7 +2259,7 @@ static void ftdi_process_read(struct work_struct *work) priv->rx_processed = 0; /* if the port is closed stop trying to read */ - if (port->port.count > 0) { + if (test_bit(ASYNCB_INITIALIZED, &port->port.flags)) { /* Continue trying to always read */ usb_fill_bulk_urb(port->read_urb, port->serial->dev, usb_rcvbulkpipe(port->serial->dev, -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html