On Mon, May 13, 2002 at 03:50:15AM -0700, David Brownell wrote: > > should device drivers call usb_get_dev() like some > > currently do (storage, some network, and the usbvideo core)? Does this > > protect something from happening that I don't see? > > I think earlier on, when the whole stack was less well developed, > device drivers doing that refcounting were getting extra protection > against various core/hcd bugs that often showed up in disconnect > paths ... which bugs are now gone.
We hope :) > > And if all drivers > > should call it, shouldn't a successful return from probe() back to the > > usb core do the call for the driver? > > At some level, it turns out not to matter whether claiming an interface > automatically adds a refcount or not ... since the important issue is really > that the device driver handle disconnect() correctly (by never using the > device handle again). If it does that, is guaranteed that everything will > clean up correctly. If it doesn't, refcounting can't solve the problem. > > > On the other hand, arguably an even better solution to this flamage > would be to hide refcounting from device drivers entirely. There > are quite a few Linux driver frameworks that don't expose it. And > since the device drivers and khubd agree on when the devices are > really going away (and need to!), it's easy to argue that such device > refcounting doesn't need to be in the device driver API at all. No, we need refcounting. See my previous response to Johannes about what Documentation/CodingStyle says. What I'm more worried about is, do you think these two patches contain anything that would cause a bug? thanks, greg k-h _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel