Alan Stern wrote:
On Sat, 1 May 2004, David Brownell wrote:


What'd be the downside of not fixing it in that way ... what kinds of
code would break if we just said dev->serialize might not always be
held during probe() or remove()?  I suspect not much...


Pretty much anything that depends on dev->serialize at all would break. For instance, we might end up binding two drivers to the same interface. Or binding a driver to an interface that is disappearing because of a configuration change.

Those particular acts would still be protected by the bus rwsem.


During set_configuration(), dev->serialize is currently serving
as a limited "logical topology lock" ... it's the only time that
the usb_interface listings in the driver model (or sysfs) won't
match the reality of the device, and that's why dev->serialize
is held.


Speaking of which, have you ever thought about what would happen to the children devices if someone used sysfs to set a hub to configuration 0, or used usbfs to unbind a hub from the hub driver?

What "would" happen is an experiment I've not done. The "should" is what I'd have thought about ... :)

  - They _should_ both cause all the devices under them to cleanly
    vanish from Linux:  no more children.


Unbinding the driver will cause a usb_set_interface(dev,0,0) -- will that disable all the ports, or will the devices remain physically accessible on the bus?

I meant that unbinding the hub driver in particular should do that... :)



  - Switching to config 0 will also do a hub reset, powering down
    and disabling all the ports.


It will also unbind the hub driver. I'm not so sure the driver will disconnect all the children, though.

If the hub driver doesn't, that'd be a bug of some kind.



I suspect that at least root hubs won't do either ... they still
don't act as much like real hubs as I'd like!


Actually we don't allow root hubs to be set to config 0.

That'd be fixable, but not currently important.


- Dave


Alan Stern








-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to