On Thu, May 03, 2012 at 02:59:25PM +0200, Rafael J. Wysocki wrote: > On Thursday, May 03, 2012, Linus Walleij wrote: > > If *all* runtime_resume() hooks for *all* devices in the same power > > domain are called at this time on the way up/down we get a major > > overhead as our primary power domain is pretty big. > FWIW, in the generic PM domains framework used on the sh7372 platform we have > a need_restore flag whose meaning is whether or not to call .runtime_suspend() > (or its domain-specific counterpart) when the domain is about to be powered > off and .runtime_resume() when the device is resumed by the runtime PM > framework. Those two callbacks are meant to save and restore the device's > state, respectively, and there are two more domain-specific callbacks, > .stop() and .start() that (in the case of sh7372) manipiulate the devices' > clocks. > So, if pm_runtime_suspend() is called for a device, we first check if it's OK > to call .stop() for it (according to PM QoS constraints), but we don't call > .runtime_suspend() for it yet at this point. Next, we check if it's OK to > power off the domain containing the device (taking PM QoS constraints and > subdomains into consideration) and if we decide to do that, we call > .runtime_suspend() for the devices in the domain, but only those whose > need_restore flags are unset. Then, if pm_runtime_resume() is called for > one of the devices, we check its need_restore flag and call .runtime_resume() > for the device if the flag set and .start() is called subsequently. This seems like a really useful idiom in general - might it be worth supporting as a standard framework feature?
Attachment:
signature.asc
Description: Digital signature