Re: USB: serial: mct_usb232: add drain on close

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 24, 2010 at 10:29:27AM -0700, Pete Zaitcev wrote:
> On Sun, 24 Jan 2010 18:03:48 +0100
> Johan Hovold <jhovold@xxxxxxxxx> wrote:
> > >  static void mct_u232_close(struct usb_serial_port *port)
> > >  {
> > > +
> > 
> > White space error.
> > 
> > >  	dbg("%s port %d", __func__, port->number);
> 
> Um, why is that again? But whatever, I'll drop it.
> 
> > > +	port->port.drain_delay = 2;
> > > +
> > 
> > You need to set drain_delay in open rather than close, as drain wait is
> > done before driver-specific close is called (see tty_port_close).
> 
> OK, I'll review this. My actual tests worked correctly with the
> above code (in release method) and failed without. And the bug is
> easily reproducible. But perhaps something changed in the last second

It can not work the first time you close the port after port probe, as
drain_delay will be uninitialised (0). The next time the port is closed
however, drain_delay will have been set correctly.

/Johan

--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux