Sorry for the late reply, catching up on old email. On Fri, Feb 07, 2003 at 09:54:07PM +0100, Duncan Sands wrote: > On Friday 07 February 2003 17:28, Oliver Neukum wrote: > > > That was a guess - and it seems wrong (I should have taken the 30 seconds > > > needed to check...). I can't in fact see anything that stops the module > > > being unloaded after a successful probe! I assumed that the driver would > > > > That's right. A driver can be unloaded even if it is bound to a device. > > It's ununloadable only during probe/disconnect/ioctl through usbfs itself. > > For anything more you are responsible yourself. That is usually done > > useing the services the character device layer provides. > > Hi Oliver, I understand better now - both the new module subsystem and > how USB uses it. However, the USB subsystem should be doing > try_module_get before any call into a driver. But there is one case in which > it doesn't: calling urb completion handlers. Isn't this wrong?
Yes, this is a problem, the module can be unloaded and then the completion fuction can be called. I talked a lot with Rusty about this problem, and he insists that the new module reference counts are lightweight enough to handle this properly. Meaning that we need to increment the module count for every urb in flight. He's going to do the same thing for skbufs. Only bad thing with this change is we need to change the api somehow to get the module reference to be assigned to the urb. We can do this either through changing the usb_submit_urb() function, or changing the urb to point to the interface it is bound to, not the dev (the interface has a pointer to the driver which has the pointer to the module reference). Any opinions on which would be better to use? Also, if anyone wants to code up a patch to do this, I would be greatly appreciate it. I'm trying to fix up the usb device reference counting logic right now and running into issues where host controllers try to access urbs after their devices have been removed from the system :( thanks, greg k-h ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
