Oliver Neukum wrote:
Am Samstag, 26. Juni 2004 20:04 schrieb David Brownell:

Oliver Neukum wrote:


Isn't a driver that's not switching to altsetting 0 in its suspend() buggy?

Why would it want to? It's supposed to come back into the same state that it was before the suspend, including config+altsettings.


But going back is the job of resume(). Shouldn't the device be quiet
in between?

It will be, since it's suspended. All suspend() needs to do is cancel/kill pending urbs.


(In principle we could get around this. If there were an addition to the API for usb_drivers, a notification function for warning about impending resets, then we could simply notify all the children's drivers. But there isn't such an API, and it's not likely to arrive during 2.6.)


There is. Suspend() and resume().

Erm, no. Those are for suspend and resume, not about_to_reset().


Why?
Suspend() is a command:
- save state
- quiet down
- leave the device alone until further notice

It's a "we're about to enter USB suspend". The "save state" is not necessary (since the device isn't allowed to lose state!). The "quiet down" is driver-specific. And usbcore will prevent any further requests from getting to the device.

Unless you want to get into defining multiple USB PM states,
in which case "power down" would be a meaningful state, but
"reset" would be what happens after power returns.


Resume():
- restore state
- you may use it again

Since there's no "save state" requirement, "restore" isn't necessary ... even data toggle shouldn't have changed.


Exactly what is needed.

Except for the semantics. With suspend(), the expectation is that the device is NOT going away.

The call before a reset should be disconnect().

- Dave




-------------------------------------------------------
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