On Wed, Oct 23, 2002 at 11:47:43AM -0700, David Brownell wrote:
> 
> 
> If we could set usb_device->dev.state to DEVICE_GONE before we start
> to disconect(), we could do even better:  we could guarantee that any
> new urb submissions would fail, so even a driver _trying_ to do the
> wrong thing wouldn't be able to do so.
> 
> If Greg's reading this thread,

I'm reading it, just sitting back, watching... :)

> I wonder if he'd comment on what it'd mean to call device_unregister()
> earlier in usb_disconnect() ... like right at the top, not the last
> thing.  The docs imply that'd be OK.

Which device_unregister?  For the interfaces or the device?

And we need to call device_unregister on our children before ourself,
like the code currently does.

But that should not matter, device_unregister() does not do much besides
remove the device from the driverfs tree.  Well, it currently could
cause the whole device's memory to be freed, but it doesn't :)

What I am working on is getting rid of the usb device reference count
(that usb_get_dev() and friends use) and use the struct device one.
That will ensure that when things like usb_submit_urb() are called, the
usb device structure can't disappear out from under it.  This logic
works today, but it needs to be cleaned up a bit.

Everyone remember, a device's reference count doesn't pertain to if the
device is physically present or not :)

thanks,

greg k-h


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to