Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1347876

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

From Ulf Hansson <ulf.hansson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v1 2/3] PM / sleep: try to runtime suspend for direct complete
Date 2016-03-02 10:30 +0100
Message-ID <r8bgu-5FN-5@gated-at.bofh.it> (permalink)
References <r5ROW-40H-7@gated-at.bofh.it> <r5ROW-40H-13@gated-at.bofh.it> <r7Zp0-5Vk-17@gated-at.bofh.it> <r8bgu-5FN-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2 March 2016 at 09:31, dbasehore . <dbasehore@chromium.org> wrote:
>
> On Mar 1, 2016 12:41, "Ulf Hansson" <ulf.hansson@linaro.org> wrote:
>>
>> On 25 February 2016 at 01:11, Derek Basehore <dbasehore@chromium.org>
>> wrote:
>> > 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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v1 1/3] PM / sleep: Check legacy pm callbacks for direct complete Derek Basehore <dbasehore@chromium.org> - 2016-02-25 01:20 +0100
  [PATCH v1 3/3] scsi: allow scsi devices to use direct complete Derek Basehore <dbasehore@chromium.org> - 2016-02-25 01:20 +0100
  [PATCH v1 2/3] PM / sleep: try to runtime suspend for direct complete Derek Basehore <dbasehore@chromium.org> - 2016-02-25 01:20 +0100
    Re: [PATCH v1 2/3] PM / sleep: try to runtime suspend for direct complete Ulf Hansson <ulf.hansson@linaro.org> - 2016-03-01 21:50 +0100
      Re: [PATCH v1 2/3] PM / sleep: try to runtime suspend for direct complete Ulf Hansson <ulf.hansson@linaro.org> - 2016-03-02 10:30 +0100

csiph-web