On Wed, Jun 09, 2004 at 02:31:35PM -0400, Alan Stern wrote:
> Greg:
> 
> This patch implements something we've been lacking for a long time: a way 
> to mark devices as USB_STATE_NOTATTACHED as soon as we know that they're 
> gone.  The usb_device->state member is no longer protected by the 
> ->serialize semaphore; instead there's a new private spinlock.  Usbcore 
> routines should no longer set ->state directly; instead they should use 
> the new utility routine usb_set_device_state().  There are protections 
> against changing states while devices are being added or removed.
> 
>       Change assignments to udev->state into calls of 
>       usb_set_device_state().
> 
>       Add new private device_state_lock to the hub driver, along
>       with usb_set_device_state() and recursively_mark_NOTATTACHED().
> 
>       Acquire the new spinlock while adding or removing children[]
>       pointers.
> 
>       When disabling a port that has a child device, mark the child
>       as NOTATTACHED.
> 
> You mentioned once having tried to do something like this and running into 
> trouble.  Take a good look and let me know if you see any difficulties 
> here.

I don't see any problems here.  My main problem was trying to test to
see if a device was present or not.  That test will never be correct, as
it can always become not present right after a successful test :)

Anyway, looks good, applied.

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to