Responses here on two points: (a) quiescing, (b) driver.devices list


Yes, that's a good way to allow concurrency:  as soon as a device
is marked "dead", take it out of the tree (sysfs would _maybe_ not
show it any more) and queue it someplace for graceful shutdown.

Whether or not that shutdown processing is concurrent, i/o on all
child devices should start quiescing ASAP.  By the time the shutdown
processing gets around to any device, maybe it'll already have been
quiesced so the shutdown part can be that much faster.


I'm not sure what you mean here. Why do you expect I/O on child devices to start quiescing quickly? More likely you'll see a flurry of error notifications and retries. Eventually things will die down, but you

As soon as you mark the device as USB_STATE_NOTATTACHED, there will be no more retries ... completions happen at whatever rate protocol timeouts kick in, but from then on there's no way to start new I/O. Like a car running out of gas, with no hills.


shouldn't expect them to stop until the drivers have been notified that their device has disconnected -- and that is part of the shutdown processing! The only way to make things stop ASAP is to run the disconnect (shutdown) processing ASAP.

Depends what level of "stop" you're talking about.


  - NOTATACCHED ... no new I/O started
  - endpoint fully disabled ... all old I/O stopped
  - after all disconnect()s ... all i/o contexts stopped using it

Though as you know, the uhci driver doesn't yet wait for all
that I/O to complete.

Key point:  the after endpoint disabling, the hardware is
known to have stopped.  Sure UHCI could clean up differently,
but that'd be visible to the usb device drivers -- which would
be required to wait for all I/O completions, like 2.4 needs.


Until you have some of telling whether a driver-model pointer points at a
usb_device or at something else, there doesn't seem to be any good way to
do this.

Shouldn't something like this enumerate all hub devices? The thing is, we know that drivers only bind to interfaces; and of course, that hub devices only have one interface.

    struct usb_interface *intf;
    struct usb_device *udev;

    list_for_each_entry (intf, &hub_driver.devices, dev.driver_list) {
        udev = interface_to_usbdev (intf);
        ... do whatever ...
    }

That obviously doesn't compile, but that's the way the driver model
keeps such lists.  Device drivers should avoid duplicate lists.

- Dave





-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&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