On Wed, Feb 19, 2003 at 09:29:37AM +0100, Duncan Sands wrote: > > @@ -853,6 +854,10 @@ > > usbfs_remove_device(dev); > > } > > device_unregister(&dev->dev); > > + > > + /* mark the device as not present so any further urb submissions for > > + * this device will fail. */ > > + dev->present = 0; > > > > /* Decrement the reference count, it'll auto free everything when */ > > /* it hits 0 which could very well be now */ > > Isn't this racy?
In a way, yes :) But what are you racing? Hm, maybe we should mark the device gone at the beginning of this call, or right at the time we realize it's gone in the hub driver. That would keep drivers from submitting urbs from within their disconnect functions. But it would also prevent them from canceling them... Ah, but the hcd drivers should have already canceled them, right? Hm, but then we don't know when the callback would have happened to be able to unload the driver safely... Nah, I think it's good where it is, if a driver is trying to do something when disconnect happens on it, the hcd can handle any problems if the present flag isn't set exactly when disconnect is happening, as it has to be able to do that right now, correct? thanks, greg k-h ------------------------------------------------------- This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The most comprehensive and flexible code editor you can use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. www.slickedit.com/sourceforge _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel