On Tue, 16 Oct 2012, Sarah Sharp wrote: > > Well, we're talking about two different things. Stopping the endpoints > > comes under the heading of "quiescing", whereas putting a link into U3 > > comes under the heading of "going to low power". FREEZE and PRETHAW > > require the host controller (and all the USB devices) to be quiescent, > > but they do not require anything to be in a low-power state. > > Ok. Is there an overview of the PM core's state machine? I'm not > familiar with it, so I'm not sure, for instance, if we get any callbacks > other than FREEZE and PRETHAW when the system hibernates. I tried > looking in Documentation, but there didn't seem to be an overview. There's Documentation/power/devices.txt. It's kind of lengthy; calling it an overview may be an exaggeration. In fact, the kerneldoc in include/linux/pm.h comes a lot closer to being a real overview. > > It seems reasonable that we could have separate callbacks for these two > > different things. FREEZE and PRETHAW could invoke the callback that > > stops a device's endpoints and skip the callback that puts the device > > into U3. > > That sounds reasonable. The only downside to adding a callback is that > I'd like to backport these patches, and I'm not sure if people will > object to adding new APIs to fix bugs in stable kernels. It can be done in two stages. The first stage does what you were thinking of before; that can be back-ported. The second stage adds the new API. > Where would disabling LPM come in? You mentioned that FREEZE and > PRETHAW don't mean "go to low power", but I think you also mentioned > that we don't get any other PM events for hibernate? So would that mean > that we would have to disable LPM in the FREEZE or PRETHAW stages? No, there are other PM events for hibernate. FREEZE is followed by THAW and POWEROFF or by RECOVER. PRETHAW (or QUIESCE) is followed (in a different kernel) by RESTORE or by RECOVER. I'm not sure if it's necessary to disable LPM during FREEZE/PRETHAW. I guess it comes down to a question of whether you think leaving it enabled while the controller is stopped would be safe. By the way, do USB-3 devices have a Resume-Recovery delay requirement (similar to the TRSMRCY delay described in section 7.1.7.7 of the USB-2 spec)? That is, how soon after the device goes from U3 back to U0 can the host start communicating with the device? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html