This might better be called "enumeration", it doesn't
relate to CONFIG_HOTPLUG at all.


> Looking at the Linux USB code (2.4.3) and I wonder why I dont have to acquire 
> any locks to access the usb_device structs. 
> When the device is disconnected in usb_disconnect() the usb_device struct is 
> freed, but no one prevents code that already has a pointer to it to access it.

Drivers storing the usb_device pointer are required to do that
safely.  Not all of them do so, given multiple contexts accessing
that pointer concurrently.  The bugs usually show up when
the drivers' disconnect routines are called on device unplug.


> And usb_hub_port_connect_change() in hub.c puts the new device into the 
> parent's children array before it's initialization is finished, so that 
> there is a device with incomplete initialization in the tree for a few 
> cycles. 

That could be a bug.

> Even though the usb_device structs are so volatile usb/devices.c does not use 
> any locks when accessing the usb_device structs. Is it tolerated that the 
> behaviour of the proc files is inpredictable and reading may crash during a 
> hot-plug action in SMP or preemtible kernels, am I missing something or is 
> this a simple bug/todo?

Might well call for a bugfix.

- Dave



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

Reply via email to