diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-04-29 22:53:22 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-01 21:25:38 +0200 |
commit | 7483b4a4d9abf9dcf1ffe6e805ead2847ec3264e (patch) | |
tree | d03af746dc3be6480580ec569e0c2d708031f0bd /kernel/power/Kconfig | |
parent | 6791e36c4a40e8930e08669e60077eea6770c429 (diff) | |
download | op-kernel-dev-7483b4a4d9abf9dcf1ffe6e805ead2847ec3264e.zip op-kernel-dev-7483b4a4d9abf9dcf1ffe6e805ead2847ec3264e.tar.gz |
PM / Sleep: Implement opportunistic sleep, v2
Introduce a mechanism by which the kernel can trigger global
transitions to a sleep state chosen by user space if there are no
active wakeup sources.
It consists of a new sysfs attribute, /sys/power/autosleep, that
can be written one of the strings returned by reads from
/sys/power/state, an ordered workqueue and a work item carrying out
the "suspend" operations. If a string representing the system's
sleep state is written to /sys/power/autosleep, the work item
triggering transitions to that state is queued up and it requeues
itself after every execution until user space writes "off" to
/sys/power/autosleep.
That work item enables the detection of wakeup events using the
functions already defined in drivers/base/power/wakeup.c (with one
small modification) and calls either pm_suspend(), or hibernate() to
put the system into a sleep state. If a wakeup event is reported
while the transition is in progress, it will abort the transition and
the "system suspend" work item will be queued up again.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'kernel/power/Kconfig')
-rw-r--r-- | kernel/power/Kconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index deb5461..6794708 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -103,6 +103,14 @@ config PM_SLEEP_SMP select HOTPLUG select HOTPLUG_CPU +config PM_AUTOSLEEP + bool "Opportunistic sleep" + depends on PM_SLEEP + default n + ---help--- + Allow the kernel to trigger a system transition into a global sleep + state automatically whenever there are no active wakeup sources. + config PM_RUNTIME bool "Run-time PM core functionality" depends on !IA64_HP_SIM |