Re: [PATCH] [usb-serial] fix Ooops on uplug

From: Alan Cox
Date: Tue Jul 21 2009 - 12:27:43 EST


> It was, at least in my case. Did some printk debugging and it showed
> that the hangup callback was entered what freed the serial device.

Ok
>
> > > This is only a lockdep warning, and I don't understand its
> > > significance. Even worse, when I plugged in a USB flash drive
> > > afterward this appeared:
> >
> > Looks like something freed the resources but didn't hang up when the
> > disconnect occurred
>
> Probably the real fix would be to let the tty layer know the device died
> from the hangup handler.

The hangup event means the physical hardware must no longer be touched so
that's already the case and we use it for a lot of things (from ISAPnP to
PCMCIA to USB).

The USB code does slightly misimplement it - it calls tty_hangup() in
usb_serial_disconnect when it should call tty_vhangup() as it needs the
event to be synchronous. That is the hangup of the tty should be done
before the USB layer can sneak off and free stuff.

I don't at this point see that as explaining the bug however
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/