Re: [linux-usb-devel] Re: [OOPS, usbcore, releaseintf] 2.6.0-test10-mm1

From: Greg KH
Date: Wed Dec 10 2003 - 15:56:24 EST


On Wed, Dec 10, 2003 at 05:02:16PM +0100, Duncan Sands wrote:
> > That's what my proposal 1 paragraph up would do. If I get the chance
> > this afternoon, I'll try to implement it if no one beats me to it...
>
> Hi Greg, so this means that rmmod will sleep in an unkillable state until
> all references are dropped?

Yes, that is what would happen.

Now you could get into a deadlock by trying something pathilogical like:
rmmod usb-hcd < /sys/devices/pci0000:00/0000:00:1d.7/usb1/idVendor

but hey, if you do that, you deserve the deadlock :)

(and yes, I know you can do this for network devices, but they have
their own thread/timer/something to prevent this deadlock from
happening...)

> I don't know if you've been following this thread or not, but the oops
> occurred when I modified usbfs to hold a reference to the usb_device
> until no-one was using a given usbfs file.

That's a good thing to do. It should work.

> I guess this means that I should change my patch so that the reference
> to the usb_device is dropped as soon as possible, right?

No, the bug should be fixed. I've seen this bug happen if someone has a
usb-serial device open and then unload the host controller driver. In
fact, I think there's a bugzilla entry just for that...

Yeah, here it is:
http://bugme.osdl.org/show_bug.cgi?id=1191

The very same oops you are seeing.

So no, it's not your fault. We need to fix the real problem.

> Thanks for looking into this,

No problem, thanks for reminding me about this.

thanks,

greg k-h
-
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/