linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/3] PM / sleep: Avoid resuming runtime-suspended devices during system suspend
@ 2014-05-13  1:02 Rafael J. Wysocki
  2014-05-13  1:03 ` [RFC][PATCH 1/3] PM / sleep: Move runtime PM barrier invocation to device_prepare() Rafael J. Wysocki
                   ` (3 more replies)
  0 siblings, 4 replies; 46+ messages in thread
From: Rafael J. Wysocki @ 2014-05-13  1:02 UTC (permalink / raw)
  To: Alan Stern, Linux PM list
  Cc: ACPI Devel Maling List, Aaron Lu, Mika Westerberg,
	Linux Kernel Mailing List, Kevin Hilman, Ulf Hansson

Hi All,

We've discussed that at length here:

http://marc.info/?t=139950469000003&r=1&w=4

but I'm starting a new thread to refresh things a bit.

This is about adding a mechanism allowing us to avoid runtime-suspended
devices during system suspend.  The reason why it has to touch the PM core
is because that needs to be coordinated across the device hierarchy.

The idea is to add a new device PM flag and to modify the PM core as follows.

 - If ->prepare() returns a positive number for a device, that means "this
   device is runtime-suspended and you can leave it like that if you do the
   same for all of its descendants".

 - If that happens, the PM core sets the new flag for the device in
   question *if* the device is indeed runtime-suspended *and* *if*
   the transition is a suspend (and not hibernation, for example).
   Otherwise, it clears the flag for the device.  All of that happens in
   device_prepare().

 - In __device_suspend() the PM core clears the new flag for the device's
   parent if it is clear for the device to ensure that the flag will only
   be set for a device if it is also set for all of its descendants.

 - PM core skips ->suspend/late/noirq and ->resume/early/noirq for all devices
   having the flag set - so the flag can be called "direct_complete" as it
   causes the PM core to go directy for the ->complete() callback when set.

 - The ->complete() callback has to check direct_complete if ->prepare()
   returned a positive number previously and is responsible for further
   handling of the device.

That is introduced by patch [2/3].

To simplify things slightly it is helpful to move the invocation of
pm_runtime_barrier() from __device_suspend() to device_prepare(), but still
under pm_runtime_get_noresume() beforehand (patch [1/3]).

Patch [3/3] shows how this can be used by adding support for it to the ACPI
PM comain.

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2014-05-19 20:03 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13  1:02 [RFC][PATCH 0/3] PM / sleep: Avoid resuming runtime-suspended devices during system suspend Rafael J. Wysocki
2014-05-13  1:03 ` [RFC][PATCH 1/3] PM / sleep: Move runtime PM barrier invocation to device_prepare() Rafael J. Wysocki
2014-05-13  9:16   ` Ulf Hansson
2014-05-13 10:35     ` Rafael J. Wysocki
2014-05-13 10:59       ` Ulf Hansson
2014-05-13 15:07         ` Rafael J. Wysocki
2014-05-13 15:19           ` Rafael J. Wysocki
2014-05-13  1:10 ` [RFC][PATCH 2/3] PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily Rafael J. Wysocki
2014-05-13  9:30   ` Ulf Hansson
2014-05-13 14:49   ` Alan Stern
2014-05-13 15:13     ` Rafael J. Wysocki
2014-05-13 15:12       ` Alan Stern
2014-05-13 15:43         ` Rafael J. Wysocki
2014-05-13 15:46           ` Alan Stern
2014-05-13 16:16             ` Rafael J. Wysocki
2014-05-13 16:19               ` Alan Stern
2014-05-13 21:29                 ` Rafael J. Wysocki
2014-05-14 14:53                   ` Alan Stern
2014-05-15 11:13                     ` Rafael J. Wysocki
2014-05-16  0:45                       ` [PATCH 0/3] (was: Re: PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily) Rafael J. Wysocki
2014-05-16  0:46                         ` [PATCH 1/3] PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily Rafael J. Wysocki
2014-05-16 14:27                           ` Alan Stern
2014-05-16 21:10                             ` Rafael J. Wysocki
2014-05-16  0:47                         ` [PATCH 2/3] PM / sleep: Update device PM documentation to cover direct_complete Rafael J. Wysocki
2014-05-16  0:48                         ` [PATCH 3/3][Resend] ACPI / PM: Avoid resuming devices in ACPI PM domain during system suspend Rafael J. Wysocki
2014-05-16 22:18                           ` [PATCH 3/3][update] " Rafael J. Wysocki
2014-05-15 12:06                     ` [RFC][PATCH 2/3] PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily Ulf Hansson
2014-05-15 12:55                       ` Rafael J. Wysocki
2014-05-15 17:35             ` Kevin Hilman
2014-05-14 22:24   ` Jacob Pan
2014-05-15 11:11     ` Rafael J. Wysocki
2014-05-15 13:09       ` Jacob Pan
2014-05-15 14:29         ` Alan Stern
2014-05-15  7:03           ` Jacob Pan
2014-05-15 15:58             ` Alan Stern
2014-05-16 15:20               ` Jacob Pan
2014-05-16 21:08                 ` Rafael J. Wysocki
2014-05-19  9:18                   ` Jacob Pan
2014-05-19 19:53                     ` Alan Stern
2014-05-19 20:13                       ` Rafael J. Wysocki
2014-05-19 20:20                     ` Rafael J. Wysocki
2014-05-13  1:10 ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain during system suspend Rafael J. Wysocki
2014-05-13 14:45 ` [RFC][PATCH 0/3] PM / sleep: Avoid resuming runtime-suspended devices " Alan Stern
2014-05-13 15:25   ` Rafael J. Wysocki
2014-05-13 15:25     ` Alan Stern
2014-05-13 15:46       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).