On Wed, 30 Jun 2004, Oliver Neukum wrote:

> > But it does mean that it's effectively impossible to do a power-off 
> > resume on such a device.  When the power gets restored the device will 
> > have "morphed" and so the hub driver will call usb_disconnect().  Perhaps 
> > you believe this is acceptable; I have no opinion one way or the other.
> 
> Better than nothing. But is there a reason the determination of "morphed"
> state must be made before resume() ?

Yes.  The idea is that if a device "morphs" then it's not really the same
device any more.  That may even be literally true; a device could be
unplugged and another one plugged into the same port.  (If this happened
during a power-on suspend we would know, because the parent hub would
report a connect-change event.  During a power-off suspend we wouldn't
know.)  Whether the change is physical or only logical, we don't want to
tell a driver it can "resume" using a different device from the one that
was suspended!

Consider, for example, that after a firmware download and reset, the 
collection of configurations and interfaces may be completely different.  
The driver being resumed would be bound to a no-longer-existing interface.

> > USB recognizes three different power states: power-on, suspended, and
> > power-off.  The question is: Should it be possible to use the power-off
> > state as a surrogate for an extremely low-power suspend state (like
> > suspend-to-disk)?  Unfortunately the current API doesn't allow for such
> > distinctions; the suspend() method in usb_driver doesn't include an
> > argument to indicate which sort of suspend is about to occur.  Oddly
> 
> Probably an error. I see no good reason to drop the argument during
> the call chain.

Although I'm not aware of the original design decisions, I imagine the API 
was intended to follow the USB specification, which has only one suspended 
state.

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to