Re: 2.6.31-rc5 regression: Oops when USB Serial disconnected while in use

Alan Stern
2009-08-21T15:43:12Z

On Fri, 21 Aug 2009, Bruno [UTF-8] PrÃ©mont wrote:

> The module refcount was for both. It's the pl2302/ftdi-sio module's
> refcount.
>
> I don't remember for sure about the panic if it also affects
> pl2302 or not.
> At least one of the panics was when running dmesg after exiting minicom.
>
> I will redo the tests this evening when I get home and report back with
> more details.

Apparently the problem is in serial_do_free(); it doesn't know
whether it's getting called for a successful open or an unsuccessful
open, so it decrements the module count when it shouldn't. The same is
true for port->dev's refcount.

Alan, related to this problem is the fact that usb_serial_driver
doesn't include a "hangup" method. I'm not sure that making
serial_hangup() call serial_do_down() is correct, but if it is then
shouldn't we call port->serial->type->open() afterwards? Otherwise the
lower driver can't know that the port is still open.

Furthermore, shouldn't we check ASYNCB_INITIALIZED in serial_close()?

Alan Stern