On Thu, Apr 18, 2002, David Brownell <[EMAIL PROTECTED]> wrote: > > I'm all for correctness, but you've made everything complicated along > > the way. > > So what's complicated? Seems simple to me. > > Device refcount is N > driver probe() > ... use the device a lot > driver disconnect () > Device refcount is back to N > > If the count isn't N then, or drops below N at any time before that > disconnect(), it's clearly a bug. > > The only change was reporting some such bugs ASAP (N=1), > preventing them from causing really hard-to-fix failure modes.
uhci_free_dev now has to walk all of the lists finding anything that might still be on them while abiding by all of the restrictions that uhci holds us to (1ms for unclean unlinks, etc). It's complicated and unnecessary. It also doesn't help in cases like usbdevfs. What if it wants to use the device structure for some reason, like say a user reading /proc/bus/usb/devices. It should increment the reference count, do it's stuff and then decrement it. But it doesn't have a deallocate like call. As a result, there's a race there. And it doesn't even help all of the hard-to-fix failure modes, it only helps 1. The reference counting change was ill-conceived. JE _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
