blob: f523e5a3ac33297999aba5c52a81b6075b0a7fa1 [file] [log] [blame]
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +02001What: /sys/power/
2Date: August 2006
Rafael J. Wysocki49db1902013-10-09 01:47:53 +02003Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +02004Description:
5 The /sys/power directory will contain files that will
6 provide a unified interface to the power management
7 subsystem.
8
9What: /sys/power/state
Rafael J. Wysocki406e7932016-11-21 22:45:40 +010010Date: November 2016
Rafael J. Wysocki49db1902013-10-09 01:47:53 +020011Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020012Description:
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020013 The /sys/power/state file controls system sleep states.
14 Reading from this file returns the available sleep state
Rafael J. Wysocki406e7932016-11-21 22:45:40 +010015 labels, which may be "mem" (suspend), "standby" (power-on
16 suspend), "freeze" (suspend-to-idle) and "disk" (hibernation).
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020017
Rafael J. Wysocki406e7932016-11-21 22:45:40 +010018 Writing one of the above strings to this file causes the system
19 to transition into the corresponding state, if available.
20
21 See Documentation/power/states.txt for more information.
22
23What: /sys/power/mem_sleep
24Date: November 2016
25Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
26Description:
27 The /sys/power/mem_sleep file controls the operating mode of
28 system suspend. Reading from it returns the available modes
29 as "s2idle" (always present), "shallow" and "deep" (present if
30 supported). The mode that will be used on subsequent attempts
31 to suspend the system (by writing "mem" to the /sys/power/state
32 file described above) is enclosed in square brackets.
33
34 Writing one of the above strings to this file causes the mode
35 represented by it to be used on subsequent attempts to suspend
36 the system.
37
38 See Documentation/power/states.txt for more information.
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020039
40What: /sys/power/disk
Rafael J. Wysockib918f6e2006-11-02 22:07:19 -080041Date: September 2006
Rafael J. Wysocki49db1902013-10-09 01:47:53 +020042Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020043Description:
44 The /sys/power/disk file controls the operating mode of the
45 suspend-to-disk mechanism. Reading from this file returns
46 the name of the method by which the system will be put to
47 sleep on the next suspend. There are four methods supported:
48 'firmware' - means that the memory image will be saved to disk
49 by some firmware, in which case we also assume that the
50 firmware will handle the system suspend.
51 'platform' - the memory image will be saved by the kernel and
52 the system will be put to sleep by the platform driver (e.g.
53 ACPI or other PM registers).
54 'shutdown' - the memory image will be saved by the kernel and
55 the system will be powered off.
56 'reboot' - the memory image will be saved by the kernel and
57 the system will be rebooted.
58
Rafael J. Wysockib918f6e2006-11-02 22:07:19 -080059 Additionally, /sys/power/disk can be used to turn on one of the
60 two testing modes of the suspend-to-disk mechanism: 'testproc'
61 or 'test'. If the suspend-to-disk mechanism is in the
62 'testproc' mode, writing 'disk' to /sys/power/state will cause
63 the kernel to disable nonboot CPUs and freeze tasks, wait for 5
64 seconds, unfreeze tasks and enable nonboot CPUs. If it is in
65 the 'test' mode, writing 'disk' to /sys/power/state will cause
66 the kernel to disable nonboot CPUs and freeze tasks, shrink
67 memory, suspend devices, wait for 5 seconds, resume devices,
68 unfreeze tasks and enable nonboot CPUs. Then, we are able to
69 look in the log messages and work out, for example, which code
70 is being slow and which device drivers are misbehaving.
71
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020072 The suspend-to-disk method may be chosen by writing to this
73 file one of the accepted strings:
74
75 'firmware'
76 'platform'
77 'shutdown'
78 'reboot'
Rafael J. Wysockib918f6e2006-11-02 22:07:19 -080079 'testproc'
80 'test'
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020081
82 It will only change to 'firmware' or 'platform' if the system
83 supports that.
84
85What: /sys/power/image_size
86Date: August 2006
Rafael J. Wysocki49db1902013-10-09 01:47:53 +020087Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +020088Description:
89 The /sys/power/image_size file controls the size of the image
90 created by the suspend-to-disk mechanism. It can be written a
91 string representing a non-negative integer that will be used
92 as an upper limit of the image size, in bytes. The kernel's
93 suspend-to-disk code will do its best to ensure the image size
94 will not exceed this number. However, if it turns out to be
95 impossible, the kernel will try to suspend anyway using the
96 smallest image possible. In particular, if "0" is written to
97 this file, the suspend image will be as small as possible.
98
99 Reading from this file will display the current image size
100 limit, which is set to 500 MB by default.
101
102What: /sys/power/pm_trace
103Date: August 2006
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200104Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +0200105Description:
106 The /sys/power/pm_trace file controls the code which saves the
107 last PM event point in the RTC across reboots, so that you can
108 debug a machine that just hangs during suspend (or more
109 commonly, during resume). Namely, the RTC is only used to save
110 the last PM event point if this file contains '1'. Initially
111 it contains '0' which may be changed to '1' by writing a
112 string representing a nonzero integer into it.
113
114 To use this debugging feature you should attempt to suspend
115 the machine, then reboot it and run
116
117 dmesg -s 1000000 | grep 'hash matches'
118
James Hogand33ac602010-10-12 00:00:25 +0200119 If you do not get any matches (or they appear to be false
120 positives), it is possible that the last PM event point
121 referred to a device created by a loadable kernel module. In
122 this case cat /sys/power/pm_trace_dev_match (see below) after
123 your system is started up and the kernel modules are loaded.
124
Rafael J. Wysocki84ed64e2006-08-30 23:38:06 +0200125 CAUTION: Using it will cause your machine's real-time (CMOS)
126 clock to be set to a random invalid time after a resume.
Rafael J. Wysocki0e06b4a2010-01-23 22:25:15 +0100127
James Hogand33ac602010-10-12 00:00:25 +0200128What; /sys/power/pm_trace_dev_match
129Date: October 2010
130Contact: James Hogan <james@albanarts.com>
131Description:
132 The /sys/power/pm_trace_dev_match file contains the name of the
133 device associated with the last PM event point saved in the RTC
134 across reboots when pm_trace has been used. More precisely it
135 contains the list of current devices (including those
136 registered by loadable kernel modules since boot) which match
137 the device hash in the RTC at boot, with a newline after each
138 one.
139
140 The advantage of this file over the hash matches printed to the
141 kernel log (see /sys/power/pm_trace), is that it includes
142 devices created after boot by loadable kernel modules.
143
144 Due to the small hash size necessary to fit in the RTC, it is
145 possible that more than one device matches the hash, in which
146 case further investigation is required to determine which
147 device is causing the problem. Note that genuine RTC clock
148 values (such as when pm_trace has not been used), can still
149 match a device and output it's name here.
150
Rafael J. Wysocki0e06b4a2010-01-23 22:25:15 +0100151What: /sys/power/pm_async
152Date: January 2009
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200153Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki0e06b4a2010-01-23 22:25:15 +0100154Description:
155 The /sys/power/pm_async file controls the switch allowing the
156 user space to enable or disable asynchronous suspend and resume
157 of devices. If enabled, this feature will cause some device
158 drivers' suspend and resume callbacks to be executed in parallel
159 with each other and with the main suspend thread. It is enabled
160 if this file contains "1", which is the default. It may be
161 disabled by writing "0" to this file, in which case all devices
162 will be suspended and resumed synchronously.
Rafael J. Wysockic125e962010-07-05 22:43:53 +0200163
164What: /sys/power/wakeup_count
165Date: July 2010
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200166Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysockic125e962010-07-05 22:43:53 +0200167Description:
168 The /sys/power/wakeup_count file allows user space to put the
169 system into a sleep state while taking into account the
170 concurrent arrival of wakeup events. Reading from it returns
171 the current number of registered wakeup events and it blocks if
172 some wakeup events are being processed at the time the file is
173 read from. Writing to it will only succeed if the current
174 number of wakeup events is equal to the written value and, if
175 successful, will make the kernel abort a subsequent transition
176 to a sleep state if any wakeup events are reported after the
177 write has returned.
Rafael J. Wysockiddeb6482011-05-15 11:38:48 +0200178
179What: /sys/power/reserved_size
180Date: May 2011
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200181Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysockiddeb6482011-05-15 11:38:48 +0200182Description:
183 The /sys/power/reserved_size file allows user space to control
184 the amount of memory reserved for allocations made by device
185 drivers during the "device freeze" stage of hibernation. It can
186 be written a string representing a non-negative integer that
187 will be used as the amount of memory to reserve for allocations
188 made by device drivers' "freeze" callbacks, in bytes.
189
190 Reading from this file will display the current value, which is
191 set to 1 MB by default.
Rafael J. Wysocki7483b4a2012-04-29 22:53:22 +0200192
193What: /sys/power/autosleep
194Date: April 2012
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200195Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysocki7483b4a2012-04-29 22:53:22 +0200196Description:
197 The /sys/power/autosleep file can be written one of the strings
198 returned by reads from /sys/power/state. If that happens, a
199 work item attempting to trigger a transition of the system to
200 the sleep state represented by that string is queued up. This
201 attempt will only succeed if there are no active wakeup sources
202 in the system at that time. After every execution, regardless
203 of whether or not the attempt to put the system to sleep has
204 succeeded, the work item requeues itself until user space
205 writes "off" to /sys/power/autosleep.
206
207 Reading from this file causes the last string successfully
208 written to it to be returned.
Rafael J. Wysockib86ff9822012-04-29 22:53:42 +0200209
210What: /sys/power/wake_lock
211Date: February 2012
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200212Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysockib86ff9822012-04-29 22:53:42 +0200213Description:
214 The /sys/power/wake_lock file allows user space to create
215 wakeup source objects and activate them on demand (if one of
216 those wakeup sources is active, reads from the
217 /sys/power/wakeup_count file block or return false). When a
218 string without white space is written to /sys/power/wake_lock,
219 it will be assumed to represent a wakeup source name. If there
220 is a wakeup source object with that name, it will be activated
221 (unless active already). Otherwise, a new wakeup source object
222 will be registered, assigned the given name and activated.
223 If a string written to /sys/power/wake_lock contains white
224 space, the part of the string preceding the white space will be
225 regarded as a wakeup source name and handled as descrived above.
226 The other part of the string will be regarded as a timeout (in
227 nanoseconds) such that the wakeup source will be automatically
228 deactivated after it has expired. The timeout, if present, is
229 set regardless of the current state of the wakeup source object
230 in question.
231
232 Reads from this file return a string consisting of the names of
233 wakeup sources created with the help of it that are active at
234 the moment, separated with spaces.
235
236
237What: /sys/power/wake_unlock
238Date: February 2012
Rafael J. Wysocki49db1902013-10-09 01:47:53 +0200239Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
Rafael J. Wysockib86ff9822012-04-29 22:53:42 +0200240Description:
241 The /sys/power/wake_unlock file allows user space to deactivate
242 wakeup sources created with the help of /sys/power/wake_lock.
243 When a string is written to /sys/power/wake_unlock, it will be
244 assumed to represent the name of a wakeup source to deactivate.
245 If a wakeup source object of that name exists and is active at
246 the moment, it will be deactivated.
247
248 Reads from this file return a string consisting of the names of
249 wakeup sources created with the help of /sys/power/wake_lock
250 that are inactive at the moment, separated with spaces.
Sameer Nanda4b7760b2012-06-19 22:23:33 +0200251
252What: /sys/power/pm_print_times
253Date: May 2012
254Contact: Sameer Nanda <snanda@chromium.org>
255Description:
256 The /sys/power/pm_print_times file allows user space to
257 control whether the time taken by devices to suspend and
258 resume is printed. These prints are useful for hunting down
259 devices that take too long to suspend or resume.
260
261 Writing a "1" enables this printing while writing a "0"
262 disables it. The default value is "0". Reading from this file
263 will display the current value.
Alexandra Yatesa6f5f0d2015-09-15 10:32:46 -0700264
265What: /sys/power/pm_wakeup_irq
266Date: April 2015
267Contact: Alexandra Yates <alexandra.yates@linux.intel.org>
268Description:
269 The /sys/power/pm_wakeup_irq file reports to user space the IRQ
270 number of the first wakeup interrupt (that is, the first
271 interrupt from an IRQ line armed for system wakeup) seen by the
272 kernel during the most recent system suspend/resume cycle.
273
274 This output is useful for system wakeup diagnostics of spurious
275 wakeup interrupts.