On Mon, 16 Apr 2007, Greg KH wrote: > > > I've got a module which registers a struct device. (It represents a > > > virtual device, not a real one, but that doesn't matter.) > > Wait, that's the issue right there. > > Don't do that. > > devices should be created by busses or the platform core, which owns the > release function for them. Individual drivers should not create > devices. > > Hm, but then, how would you ever unload a bus, as the same issue might > be there too... > > Any specific code in the kernel you can point to that has this issue > today?
I first noticed it while working with dummy_hcd. It creates a virtual host controller platform device and a virtual device controller platform device. Its exit routine doesn't wait (and has no way to wait) for the release methods of those devices to finish executing. But the same issue tends to pop up anywhere you have a "bridge" device -- one that connects two different kinds of bus. For instance, a PC-card essentially bridges a CardBus to whatever you can plug into that card. usb-storage essentially bridges a USB bus to a SCSI bus. uhci-hcd essentially bridges a PCI bus to a USB bus. The problem itself isn't very noticeable. Existing uses of try_module_get() generally reduce it to an unlikely race, and the uncoupling of sysfs from devices will make it even rarer. But the problem still exists potentially. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel