RFC (was: Re: PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices)
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest0 of 3 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 3 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/3] (was: Re: PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices)
Quoted 30 lines · Rafael J. Wysocki
Quoted 21 lines · Rafael J. Wysocki
Quoted 20 lines · Alan Stern
Quoted 17 lines · Rafael J. Wysocki
Quoted 6 lines
Quoted 4 lines
Wait a minute. Following ->runtime_suspend(), you are going to call ->suspend() and then ->runtime_resume()? That doesn't seem like what you really want; a ->suspend() call should always have a matching ->resume().
Yes, it should, but I didn't see any other way to do that.
Actually, that's kind of easy to resolve. :-)
When ->suspend() leaves power.leave_runtime_suspended set, the PM core can simply skip the early/late and noirq callbacks and then call ->resume() that will be responsible for using whatever is necessary to resume the device.
And perhaps the flag should be called something different then, like
direct_resume(meaning go directly for ->resume() without executing the intermediate callbacks)?Quoted 5 lines
Quoted 3 lines
In light of what I wrote earlier, it should be okay for the ->prepare() callback to be responsible for setting
leave_runtime_suspended. Then there will be no need to call either ->suspend() or ->resume().Hmm. OK, let's try that.
Well, no.
Quoted 7 lines
The reason why that doesn't work is because ->prepare() callbacks are executed in the reverse order, so the perent's ones will be run before the ->prepare() of the children. Thus if ->prepare() sets the flag with the expectation that ->suspend() (and the subsequent callbacks) won't be executed, that expectation may not be met actually.
So I'm going to do what I said above. I prefer it anyway. :-)
Reworked patches follow (again).
I followed the Ulf's suggestion to make the helpers depend on PM_RUNTIME instead of adding the new CONFIG_ symbol.
Rafael