On Mon, 17 Dec 2001, Vojtech Pavlik wrote:

> > Well, as explained in the other posting, suspend/resume is pretty much
> > different from unplug/replug because a suspended device is still drawing
> > some power from the suspended USB. This way even a buspowered device can
> > keep its state and the host can be sure, it's still the same device which
> > he will resume later on.
> 
> How? The host will not be notified when the device is unplugged and
> replugged while suspended.

The HC has to monitor the USB state anyway - at least if it supports
remote wakeup. A device which signals remote wakeup executes exactly a
simulated disconnect/reconnect cycle on the USB which triggers the host
to resume, if enabled. If the host is unable to monitor the bus state
(I don't know whether this applies to _any_ HC D* state), you are right,
it can't tell. But in this case the HC is required to signal a connect
when resuming operation anyway - it's all in chapter 9 of the USB specs.

> > For unplug/replug OTOH I agree it's a good idea to have the device keep
> > its state as much as it makes sense - but the host _must not_ make any
> > assumption here because the replugged device might just be a different one
> > or might have been plugged to a different host meanwhile.
> 
> The host should pass all the relevant information to an userspace agent,
> which can then decide (even can let the user decide if really needed)
> whether it is the same device and should be used as such or not.

Do you really believe in average users' ability to decide whether a device
which was connected to a different box meanwhile is still the
"same" device?

> You usually will want a replacement device just work without having to
> restart all the programs using it.

So you wan't the application which has open files on a usb-disk to
continue writing to these files if there is a replacement device there
after suspend/resume (with unplug/replug)?
I doubt that's what you wanted to say?
IMHO the HC+HCD can tell whether this can be treated as a resume or not.
If not, the application shall be forced to close all open files...

Martin


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

Reply via email to