diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-04-29 16:53:22 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-01 15:25:38 -0400 |
commit | 7483b4a4d9abf9dcf1ffe6e805ead2847ec3264e (patch) | |
tree | d03af746dc3be6480580ec569e0c2d708031f0bd /Documentation/ABI/testing/sysfs-power | |
parent | 6791e36c4a40e8930e08669e60077eea6770c429 (diff) |
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 'Documentation/ABI/testing/sysfs-power')
-rw-r--r-- | Documentation/ABI/testing/sysfs-power | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power index b464d12761ba..237c735db6c9 100644 --- a/Documentation/ABI/testing/sysfs-power +++ b/Documentation/ABI/testing/sysfs-power | |||
@@ -172,3 +172,20 @@ Description: | |||
172 | 172 | ||
173 | Reading from this file will display the current value, which is | 173 | Reading from this file will display the current value, which is |
174 | set to 1 MB by default. | 174 | set to 1 MB by default. |
175 | |||
176 | What: /sys/power/autosleep | ||
177 | Date: April 2012 | ||
178 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
179 | Description: | ||
180 | The /sys/power/autosleep file can be written one of the strings | ||
181 | returned by reads from /sys/power/state. If that happens, a | ||
182 | work item attempting to trigger a transition of the system to | ||
183 | the sleep state represented by that string is queued up. This | ||
184 | attempt will only succeed if there are no active wakeup sources | ||
185 | in the system at that time. After every execution, regardless | ||
186 | of whether or not the attempt to put the system to sleep has | ||
187 | succeeded, the work item requeues itself until user space | ||
188 | writes "off" to /sys/power/autosleep. | ||
189 | |||
190 | Reading from this file causes the last string successfully | ||
191 | written to it to be returned. | ||