Thread (1 message) 1 message, 1 author, 2016-03-02

Re: [PATCH v1 2/3] PM / sleep: try to runtime suspend for direct complete

From: Ulf Hansson <hidden>
Date: 2016-03-02 09:26:48
Also in: linux-scsi, lkml

On 2 March 2016 at 09:31, dbasehore . [off-list ref] wrote:
On Mar 1, 2016 12:41, "Ulf Hansson" [off-list ref] wrote:
quoted
On 25 February 2016 at 01:11, Derek Basehore [off-list ref]
wrote:
quoted
This tries to runtime suspend devices that are still active for direct
complete. This is for cases such as autosuspend delays which leaves
devices able to runtime suspend but still active. It's beneficial in
this case to runtime suspend the device to take advantage of direct
complete when possible.
Unfortunate this doesn't work. In the device_prepare() phase the PM
core prevents runtime suspend via a call to pm_runtime_get_noresume().

Kind regards
Uffe
A call to pm_runtime_put_sync_suspend should work. We can't do this
earlier, because we don't know if the device will actually use
direct_complete due to its children. Calling pm_runtime_put_noidle may
allow another pm_runtime_put to runtime suspend the device, but we're
trying to do that anyways. Also, we can't just call ...put_sync since that
might not suspend due to autosuspend delays.

We just need to balance the call with another get_noresume after. Am I
missing anything?
Yes.

The important part that you need to take into consideration is the
sysfs intererface for runtime PM of devices. It allows userspace to
prevent runtime PM suspend (pm_runtime_forbid()). Therefore, you
simply can not rely on the regular runtime PM APIs to put a device
into low power state during system PM.

In cases of a runtime PM centric subsystem/driver, it can instead use
pm_runtime_force_suspend().

Kind regards
Uffe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help