On Thu, 2006-04-13 at 00:37 +0200, Guennadi Liakhovetski wrote:
> On Wed, 12 Apr 2006, Greg KH wrote:
> 
> > > Problem 3. Recursive error-messages on dongle-unplug, which render the 
> > > system unusable. Here again, the proper solution would be to implement 
> > > some usb_serial_console_disconnect() which would prevent sending output 
> > > to 
> > > a disconnected port. A possible implementation is also included below. 
> > > Paul had a different version, whereby he was calling 
> > > unregister_console(), 
> > > which I was not sure about. Anyway, none of these disconnect() 
> > > implementations alone suffice to fix the problem. What indeed fixes it is 
> > > a check for (port->serial->dev->state == USB_STATE_NOTATTACHED) in 
> > > usb_console_write(). Just in case the same check was added to 
> > > serial_write() in drivers/usb/serial/usb-serial.c.
> > 
> > 
> > Hm, usb_serial_console_disconnect() is probably the proper way to do
> > this.

We probably need both.

Checking the device state on console write is necessary
to prevent lockup on console write. I'm assuming
there is some kind of recursion problem, but the
lock could be something else.

usb_serial_console_disconnect() cleans up so there
is not a stale port pointer hanging around that is
part of a now invalid console registration. CPU cycles
are saved by not having the console subsystem constantly
trying to write to a device that is not there.

--
Paul



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to