All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/3] PM: Mechanism to avoid resuming runtime-suspended devices during system suspend
@ 2014-01-14 23:12 Rafael J. Wysocki
  2014-01-14 23:13 ` [RFC][PATCH 1/3] PM / sleep: Flag to avoid executing suspend callbacks for devices Rafael J. Wysocki
                   ` (3 more replies)
  0 siblings, 4 replies; 79+ messages in thread
From: Rafael J. Wysocki @ 2014-01-14 23:12 UTC (permalink / raw)
  To: Linux PM list
  Cc: Alan Stern, Mika Westerberg, Aaron Lu, ACPI Devel Maling List, LKML

Hi,

The following experimental series of 3 patches implements a mechanism allowing
subsystems to avoid resuming runtime-suspended devices during system suspend.

As far as the PM core goes, it introduces a new flag, power.no_suspend, that
will be set by the core for devices which can stay suspended.  The idea is that
subsystems should know which devices can stay suspended over system suspend
and to allow them to tell the core about that patch [1/3] changes the calling
convention of the device PM .prepare() callback so that it can return a positive
value on success to be interpreted as "this device has been runtime-suspended
and doesn't need to be resumed" information.  If .prepare() returns a positive
number for certain device, the core will set power.no_suspend and will not run
suspend callbacks for device with that flag set going forward (during this
particular system suspend transition).

However, parents may generally need to be resumed so that the suspend of their
children can be carried out, so the PM core will clear power.no_suspend for
the parents of devices whose power.no_suspend is not set (unless those parents
have power.ignore_children set).

Patch [2/3] adds a new runtime PM helper function that subsystems can use to
check whether or not a given device is runtime-suspended when .prepare() is being
executed for it.

Patch [3/3] implements the subsystem part for the ACPI PM domain, because that
is relatively straightforward.  If the general approach makes sense, I'll think
about doing the same for PCI.

Comments welcome!

Thanks,
Rafael


^ permalink raw reply	[flat|nested] 79+ messages in thread
* [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:10 ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
  0 siblings, 1 reply; 79+ 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] 79+ messages in thread

end of thread, other threads:[~2014-05-13  1:10 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 23:12 [RFC][PATCH 0/3] PM: Mechanism to avoid resuming runtime-suspended devices during system suspend Rafael J. Wysocki
2014-01-14 23:13 ` [RFC][PATCH 1/3] PM / sleep: Flag to avoid executing suspend callbacks for devices Rafael J. Wysocki
2014-01-14 23:14 ` [RFC][PATCH 2/3] PM / runtime: Routine for checking device status during system suspend Rafael J. Wysocki
2014-01-16 13:32   ` Mika Westerberg
2014-01-16 16:07     ` [Update][RFC][PATCH " Rafael J. Wysocki
2014-01-14 23:16 ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
2014-01-15 13:57   ` [Update][RFC][PATCH " Rafael J. Wysocki
2014-02-16 23:49 ` [RFC][PATCH 0/3] PM: Mechanism to avoid resuming runtime-suspended devices " Rafael J. Wysocki
2014-02-16 23:50   ` [PATCH 1/3] PM / sleep: New flag to speed up suspend-resume of suspended devices Rafael J. Wysocki
2014-02-18 12:59     ` Ulf Hansson
2014-02-18 13:25       ` Rafael J. Wysocki
2014-02-19 17:01     ` Alan Stern
2014-02-20  1:23       ` Rafael J. Wysocki
2014-02-20  1:42         ` Rafael J. Wysocki
2014-02-20 17:03         ` Alan Stern
2014-02-24  0:00           ` Rafael J. Wysocki
2014-02-24 19:36             ` Alan Stern
2014-02-25  0:07               ` Rafael J. Wysocki
2014-02-25 17:08                 ` Alan Stern
2014-02-25 23:56                   ` Rafael J. Wysocki
2014-02-26 16:49                     ` Alan Stern
2014-02-26 21:44                       ` Rafael J. Wysocki
2014-02-26 22:17                         ` Alan Stern
2014-02-26 23:13                           ` Rafael J. Wysocki
2014-02-27 15:02                             ` Alan Stern
2014-04-24 22:36                               ` [RFC][PATCH 0/3] PM: Mechanism to avoid resuming runtime-suspended devices during system suspend, v2 Rafael J. Wysocki
2014-04-24 22:37                                 ` [RFC][PATCH 1/3] PM / sleep: Flags to speed up suspend-resume of runtime-suspended devices Rafael J. Wysocki
2014-05-01 21:39                                   ` Alan Stern
2014-05-01 23:15                                     ` Rafael J. Wysocki
2014-05-01 23:36                                       ` Rafael J. Wysocki
2014-05-02  0:04                                         ` Rafael J. Wysocki
2014-05-02 15:41                                           ` Rafael J. Wysocki
2014-05-02 18:44                                             ` Alan Stern
2014-05-05  0:09                                               ` Rafael J. Wysocki
2014-05-05 15:46                                                 ` Alan Stern
2014-05-06  1:31                                                   ` Rafael J. Wysocki
2014-05-06 19:31                                                     ` Alan Stern
2014-05-07  0:36                                                       ` Rafael J. Wysocki
2014-05-07 15:43                                                         ` Alan Stern
2014-05-07 23:27                                                           ` [RFC][PATCH 0/3] (was: Re: [RFC][PATCH 1/3] PM / sleep: Flags to speed up suspend-resume of runtime-suspended devices) Rafael J. Wysocki
2014-05-07 23:29                                                             ` [RFC][PATCH 1/3] PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices Rafael J. Wysocki
2014-05-08  7:49                                                               ` Ulf Hansson
2014-05-08 10:53                                                                 ` Rafael J. Wysocki
2014-05-08 10:59                                                                   ` Ulf Hansson
2014-05-08 11:44                                                                     ` Rafael J. Wysocki
2014-05-08 12:25                                                                       ` Ulf Hansson
2014-05-08 20:02                                                                         ` Rafael J. Wysocki
2014-05-08 14:36                                                                     ` Alan Stern
2014-05-08 14:57                                                               ` Alan Stern
2014-05-08 20:17                                                                 ` Rafael J. Wysocki
2014-05-08 21:03                                                                   ` Rafael J. Wysocki
2014-05-08 21:20                                                                     ` Alan Stern
2014-05-08 21:42                                                                       ` Rafael J. Wysocki
2014-05-08 21:50                                                                         ` Rafael J. Wysocki
2014-05-08 22:28                                                                           ` [RFC][PATCH 0/3] (was: Re: PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices) Rafael J. Wysocki
2014-05-08 22:41                                                                             ` [RFC][PATCH 1/3] PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices Rafael J. Wysocki
2014-05-09  7:23                                                                               ` Ulf Hansson
2014-05-09 11:33                                                                                 ` Rafael J. Wysocki
2014-05-08 22:41                                                                             ` [RFC][PATCH 2/3] PM / runtime: Routine for checking device status during system suspend Rafael J. Wysocki
2014-05-08 22:42                                                                             ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
2014-05-09  1:52                                                                           ` [RFC][PATCH 1/3] PM / sleep: Flag to speed up suspend-resume of runtime-suspended devices Alan Stern
2014-05-09 22:49                                                                             ` Rafael J. Wysocki
2014-05-11 16:46                                                                               ` Alan Stern
2014-05-13  0:51                                                                                 ` Rafael J. Wysocki
2014-05-08 21:08                                                                   ` Alan Stern
2014-05-09 22:48                                                               ` Kevin Hilman
2014-05-10  1:38                                                                 ` Rafael J. Wysocki
2014-05-12 16:33                                                                   ` Kevin Hilman
2014-05-07 23:31                                                             ` [Resend][PATCH 2/3] PM / runtime: Routine for checking device status during system suspend Rafael J. Wysocki
2014-05-07 23:33                                                             ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
2014-05-08 14:59                                                               ` Alan Stern
2014-05-08 19:40                                                                 ` Rafael J. Wysocki
2014-05-02 16:12                                         ` [RFC][PATCH 1/3] PM / sleep: Flags to speed up suspend-resume of runtime-suspended devices Alan Stern
2014-04-24 22:39                                 ` [RFC][PATCH 2/3][Resend] PM / runtime: Routine for checking device status during system suspend Rafael J. Wysocki
2014-04-25 11:28                                   ` Ulf Hansson
2014-04-24 22:40                                 ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
2014-02-16 23:51   ` [PATCH 2/3][Resend] PM / runtime: Routine for checking device status " Rafael J. Wysocki
2014-02-16 23:52   ` [PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki
2014-05-13  1:02 [RFC][PATCH 0/3] PM / sleep: Avoid resuming runtime-suspended devices " Rafael J. Wysocki
2014-05-13  1:10 ` [RFC][PATCH 3/3] ACPI / PM: Avoid resuming devices in ACPI PM domain " Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.