457 lines · plain
1What: /sys/power/2Date: August 20063Contact: Rafael J. Wysocki <rjw@rjwysocki.net>4Description:5 The /sys/power directory will contain files that will6 provide a unified interface to the power management7 subsystem.8 9What: /sys/power/state10Date: November 201611Contact: Rafael J. Wysocki <rjw@rjwysocki.net>12Description:13 The /sys/power/state file controls system sleep states.14 Reading from this file returns the available sleep state15 labels, which may be "mem" (suspend), "standby" (power-on16 suspend), "freeze" (suspend-to-idle) and "disk" (hibernation).17 18 Writing one of the above strings to this file causes the system19 to transition into the corresponding state, if available.20 21 See Documentation/admin-guide/pm/sleep-states.rst for more22 information.23 24What: /sys/power/mem_sleep25Date: November 201626Contact: Rafael J. Wysocki <rjw@rjwysocki.net>27Description:28 The /sys/power/mem_sleep file controls the operating mode of29 system suspend. Reading from it returns the available modes30 as "s2idle" (always present), "shallow" and "deep" (present if31 supported). The mode that will be used on subsequent attempts32 to suspend the system (by writing "mem" to the /sys/power/state33 file described above) is enclosed in square brackets.34 35 Writing one of the above strings to this file causes the mode36 represented by it to be used on subsequent attempts to suspend37 the system.38 39 See Documentation/admin-guide/pm/sleep-states.rst for more40 information.41 42What: /sys/power/disk43Date: September 200644Contact: Rafael J. Wysocki <rjw@rjwysocki.net>45Description:46 The /sys/power/disk file controls the operating mode of the47 suspend-to-disk mechanism. Reading from this file returns48 the name of the method by which the system will be put to49 sleep on the next suspend. There are four methods supported:50 51 'firmware' - means that the memory image will be saved to disk52 by some firmware, in which case we also assume that the53 firmware will handle the system suspend.54 55 'platform' - the memory image will be saved by the kernel and56 the system will be put to sleep by the platform driver (e.g.57 ACPI or other PM registers).58 59 'shutdown' - the memory image will be saved by the kernel and60 the system will be powered off.61 62 'reboot' - the memory image will be saved by the kernel and63 the system will be rebooted.64 65 Additionally, /sys/power/disk can be used to turn on one of the66 two testing modes of the suspend-to-disk mechanism: 'testproc'67 or 'test'. If the suspend-to-disk mechanism is in the68 'testproc' mode, writing 'disk' to /sys/power/state will cause69 the kernel to disable nonboot CPUs and freeze tasks, wait for 570 seconds, unfreeze tasks and enable nonboot CPUs. If it is in71 the 'test' mode, writing 'disk' to /sys/power/state will cause72 the kernel to disable nonboot CPUs and freeze tasks, shrink73 memory, suspend devices, wait for 5 seconds, resume devices,74 unfreeze tasks and enable nonboot CPUs. Then, we are able to75 look in the log messages and work out, for example, which code76 is being slow and which device drivers are misbehaving.77 78 The suspend-to-disk method may be chosen by writing to this79 file one of the accepted strings:80 81 - 'firmware'82 - 'platform'83 - 'shutdown'84 - 'reboot'85 - 'testproc'86 - 'test'87 88 It will only change to 'firmware' or 'platform' if the system89 supports that.90 91What: /sys/power/image_size92Date: August 200693Contact: Rafael J. Wysocki <rjw@rjwysocki.net>94Description:95 The /sys/power/image_size file controls the size of the image96 created by the suspend-to-disk mechanism. It can be written a97 string representing a non-negative integer that will be used98 as an upper limit of the image size, in bytes. The kernel's99 suspend-to-disk code will do its best to ensure the image size100 will not exceed this number. However, if it turns out to be101 impossible, the kernel will try to suspend anyway using the102 smallest image possible. In particular, if "0" is written to103 this file, the suspend image will be as small as possible.104 105 Reading from this file will display the current image size106 limit, which is set to around 2/5 of available RAM by default.107 108What: /sys/power/pm_trace109Date: August 2006110Contact: Rafael J. Wysocki <rjw@rjwysocki.net>111Description:112 The /sys/power/pm_trace file controls the code which saves the113 last PM event point in the RTC across reboots, so that you can114 debug a machine that just hangs during suspend (or more115 commonly, during resume). Namely, the RTC is only used to save116 the last PM event point if this file contains '1'. Initially117 it contains '0' which may be changed to '1' by writing a118 string representing a nonzero integer into it.119 120 To use this debugging feature you should attempt to suspend121 the machine, then reboot it and run::122 123 dmesg -s 1000000 | grep 'hash matches'124 125 If you do not get any matches (or they appear to be false126 positives), it is possible that the last PM event point127 referred to a device created by a loadable kernel module. In128 this case cat /sys/power/pm_trace_dev_match (see below) after129 your system is started up and the kernel modules are loaded.130 131 CAUTION: Using it will cause your machine's real-time (CMOS)132 clock to be set to a random invalid time after a resume.133 134What; /sys/power/pm_trace_dev_match135Date: October 2010136Contact: James Hogan <jhogan@kernel.org>137Description:138 The /sys/power/pm_trace_dev_match file contains the name of the139 device associated with the last PM event point saved in the RTC140 across reboots when pm_trace has been used. More precisely it141 contains the list of current devices (including those142 registered by loadable kernel modules since boot) which match143 the device hash in the RTC at boot, with a newline after each144 one.145 146 The advantage of this file over the hash matches printed to the147 kernel log (see /sys/power/pm_trace), is that it includes148 devices created after boot by loadable kernel modules.149 150 Due to the small hash size necessary to fit in the RTC, it is151 possible that more than one device matches the hash, in which152 case further investigation is required to determine which153 device is causing the problem. Note that genuine RTC clock154 values (such as when pm_trace has not been used), can still155 match a device and output its name here.156 157What: /sys/power/pm_async158Date: January 2009159Contact: Rafael J. Wysocki <rjw@rjwysocki.net>160Description:161 The /sys/power/pm_async file controls the switch allowing the162 user space to enable or disable asynchronous suspend and resume163 of devices. If enabled, this feature will cause some device164 drivers' suspend and resume callbacks to be executed in parallel165 with each other and with the main suspend thread. It is enabled166 if this file contains "1", which is the default. It may be167 disabled by writing "0" to this file, in which case all devices168 will be suspended and resumed synchronously.169 170What: /sys/power/wakeup_count171Date: July 2010172Contact: Rafael J. Wysocki <rjw@rjwysocki.net>173Description:174 The /sys/power/wakeup_count file allows user space to put the175 system into a sleep state while taking into account the176 concurrent arrival of wakeup events. Reading from it returns177 the current number of registered wakeup events and it blocks if178 some wakeup events are being processed at the time the file is179 read from. Writing to it will only succeed if the current180 number of wakeup events is equal to the written value and, if181 successful, will make the kernel abort a subsequent transition182 to a sleep state if any wakeup events are reported after the183 write has returned.184 185What: /sys/power/reserved_size186Date: May 2011187Contact: Rafael J. Wysocki <rjw@rjwysocki.net>188Description:189 The /sys/power/reserved_size file allows user space to control190 the amount of memory reserved for allocations made by device191 drivers during the "device freeze" stage of hibernation. It can192 be written a string representing a non-negative integer that193 will be used as the amount of memory to reserve for allocations194 made by device drivers' "freeze" callbacks, in bytes.195 196 Reading from this file will display the current value, which is197 set to 1 MB by default.198 199What: /sys/power/autosleep200Date: April 2012201Contact: Rafael J. Wysocki <rjw@rjwysocki.net>202Description:203 The /sys/power/autosleep file can be written one of the strings204 returned by reads from /sys/power/state. If that happens, a205 work item attempting to trigger a transition of the system to206 the sleep state represented by that string is queued up. This207 attempt will only succeed if there are no active wakeup sources208 in the system at that time. After every execution, regardless209 of whether or not the attempt to put the system to sleep has210 succeeded, the work item requeues itself until user space211 writes "off" to /sys/power/autosleep.212 213 Reading from this file causes the last string successfully214 written to it to be returned.215 216What: /sys/power/wake_lock217Date: February 2012218Contact: Rafael J. Wysocki <rjw@rjwysocki.net>219Description:220 The /sys/power/wake_lock file allows user space to create221 wakeup source objects and activate them on demand (if one of222 those wakeup sources is active, reads from the223 /sys/power/wakeup_count file block or return false). When a224 string without white space is written to /sys/power/wake_lock,225 it will be assumed to represent a wakeup source name. If there226 is a wakeup source object with that name, it will be activated227 (unless active already). Otherwise, a new wakeup source object228 will be registered, assigned the given name and activated.229 If a string written to /sys/power/wake_lock contains white230 space, the part of the string preceding the white space will be231 regarded as a wakeup source name and handled as descrived above.232 The other part of the string will be regarded as a timeout (in233 nanoseconds) such that the wakeup source will be automatically234 deactivated after it has expired. The timeout, if present, is235 set regardless of the current state of the wakeup source object236 in question.237 238 Reads from this file return a string consisting of the names of239 wakeup sources created with the help of it that are active at240 the moment, separated with spaces.241 242 243What: /sys/power/wake_unlock244Date: February 2012245Contact: Rafael J. Wysocki <rjw@rjwysocki.net>246Description:247 The /sys/power/wake_unlock file allows user space to deactivate248 wakeup sources created with the help of /sys/power/wake_lock.249 When a string is written to /sys/power/wake_unlock, it will be250 assumed to represent the name of a wakeup source to deactivate.251 252 If a wakeup source object of that name exists and is active at253 the moment, it will be deactivated.254 255 Reads from this file return a string consisting of the names of256 wakeup sources created with the help of /sys/power/wake_lock257 that are inactive at the moment, separated with spaces.258 259What: /sys/power/pm_print_times260Date: May 2012261Contact: Sameer Nanda <snanda@chromium.org>262Description:263 The /sys/power/pm_print_times file allows user space to264 control whether the time taken by devices to suspend and265 resume is printed. These prints are useful for hunting down266 devices that take too long to suspend or resume.267 268 Writing a "1" enables this printing while writing a "0"269 disables it. The default value is "0". Reading from this file270 will display the current value.271 272What: /sys/power/pm_wakeup_irq273Date: April 2015274Contact: Alexandra Yates <alexandra.yates@linux.intel.org>275Description:276 The /sys/power/pm_wakeup_irq file reports to user space the IRQ277 number of the first wakeup interrupt (that is, the first278 interrupt from an IRQ line armed for system wakeup) seen by the279 kernel during the most recent system suspend/resume cycle.280 281 This output is useful for system wakeup diagnostics of spurious282 wakeup interrupts.283 284What: /sys/power/pm_debug_messages285Date: July 2017286Contact: Rafael J. Wysocki <rjw@rjwysocki.net>287Description:288 The /sys/power/pm_debug_messages file controls the printing289 of debug messages from the system suspend/hiberbation290 infrastructure to the kernel log.291 292 Writing a "1" to this file enables the debug messages and293 writing a "0" (default) to it disables them. Reads from294 this file return the current value.295 296What: /sys/power/resume_offset297Date: April 2018298Contact: Mario Limonciello <mario.limonciello@outlook.com>299Description:300 This file is used for telling the kernel an offset into a disk301 to use when hibernating the system such as with a swap file.302 303 Reads from this file will display the current offset304 the kernel will be using on the next hibernation305 attempt.306 307 Using this sysfs file will override any values that were308 set using the kernel command line for disk offset.309 310What: /sys/power/suspend_stats311Date: July 2019312Contact: Kalesh Singh <kaleshsingh96@gmail.com>313Description:314 The /sys/power/suspend_stats directory contains suspend related315 statistics.316 317What: /sys/power/suspend_stats/success318Date: July 2019319Contact: Kalesh Singh <kaleshsingh96@gmail.com>320Description:321 The /sys/power/suspend_stats/success file contains the number322 of times entering system sleep state succeeded.323 324What: /sys/power/suspend_stats/fail325Date: July 2019326Contact: Kalesh Singh <kaleshsingh96@gmail.com>327Description:328 The /sys/power/suspend_stats/fail file contains the number329 of times entering system sleep state failed.330 331What: /sys/power/suspend_stats/failed_freeze332Date: July 2019333Contact: Kalesh Singh <kaleshsingh96@gmail.com>334Description:335 The /sys/power/suspend_stats/failed_freeze file contains the336 number of times freezing processes failed.337 338What: /sys/power/suspend_stats/failed_prepare339Date: July 2019340Contact: Kalesh Singh <kaleshsingh96@gmail.com>341Description:342 The /sys/power/suspend_stats/failed_prepare file contains the343 number of times preparing all non-sysdev devices for344 a system PM transition failed.345 346What: /sys/power/suspend_stats/failed_resume347Date: July 2019348Contact: Kalesh Singh <kaleshsingh96@gmail.com>349Description:350 The /sys/power/suspend_stats/failed_resume file contains the351 number of times executing "resume" callbacks of352 non-sysdev devices failed.353 354What: /sys/power/suspend_stats/failed_resume_early355Date: July 2019356Contact: Kalesh Singh <kaleshsingh96@gmail.com>357Description:358 The /sys/power/suspend_stats/failed_resume_early file contains359 the number of times executing "early resume" callbacks360 of devices failed.361 362What: /sys/power/suspend_stats/failed_resume_noirq363Date: July 2019364Contact: Kalesh Singh <kaleshsingh96@gmail.com>365Description:366 The /sys/power/suspend_stats/failed_resume_noirq file contains367 the number of times executing "noirq resume" callbacks368 of devices failed.369 370What: /sys/power/suspend_stats/failed_suspend371Date: July 2019372Contact: Kalesh Singh <kaleshsingh96@gmail.com>373Description:374 The /sys/power/suspend_stats/failed_suspend file contains375 the number of times executing "suspend" callbacks376 of all non-sysdev devices failed.377 378What: /sys/power/suspend_stats/failed_suspend_late379Date: July 2019380Contact: Kalesh Singh <kaleshsingh96@gmail.com>381Description:382 The /sys/power/suspend_stats/failed_suspend_late file contains383 the number of times executing "late suspend" callbacks384 of all devices failed.385 386What: /sys/power/suspend_stats/failed_suspend_noirq387Date: July 2019388Contact: Kalesh Singh <kaleshsingh96@gmail.com>389Description:390 The /sys/power/suspend_stats/failed_suspend_noirq file contains391 the number of times executing "noirq suspend" callbacks392 of all devices failed.393 394What: /sys/power/suspend_stats/last_failed_dev395Date: July 2019396Contact: Kalesh Singh <kaleshsingh96@gmail.com>397Description:398 The /sys/power/suspend_stats/last_failed_dev file contains399 the last device for which a suspend/resume callback failed.400 401What: /sys/power/suspend_stats/last_failed_errno402Date: July 2019403Contact: Kalesh Singh <kaleshsingh96@gmail.com>404Description:405 The /sys/power/suspend_stats/last_failed_errno file contains406 the errno of the last failed attempt at entering407 system sleep state.408 409What: /sys/power/suspend_stats/last_failed_step410Date: July 2019411Contact: Kalesh Singh <kaleshsingh96@gmail.com>412Description:413 The /sys/power/suspend_stats/last_failed_step file contains414 the last failed step in the suspend/resume path.415 416What: /sys/power/suspend_stats/last_hw_sleep417Date: June 2023418Contact: Mario Limonciello <mario.limonciello@amd.com>419Description:420 The /sys/power/suspend_stats/last_hw_sleep file421 contains the duration of time spent in a hardware sleep422 state in the most recent system suspend-resume cycle.423 This number is measured in microseconds.424 425What: /sys/power/suspend_stats/total_hw_sleep426Date: June 2023427Contact: Mario Limonciello <mario.limonciello@amd.com>428Description:429 The /sys/power/suspend_stats/total_hw_sleep file430 contains the aggregate of time spent in a hardware sleep431 state since the kernel was booted. This number432 is measured in microseconds.433 434What: /sys/power/suspend_stats/max_hw_sleep435Date: June 2023436Contact: Mario Limonciello <mario.limonciello@amd.com>437Description:438 The /sys/power/suspend_stats/max_hw_sleep file439 contains the maximum amount of time that the hardware can440 report for time spent in a hardware sleep state. When sleep441 cycles are longer than this time, the values for442 'total_hw_sleep' and 'last_hw_sleep' may not be accurate.443 This number is measured in microseconds.444 445What: /sys/power/sync_on_suspend446Date: October 2019447Contact: Jonas Meurer <jonas@freesources.org>448Description:449 This file controls whether or not the kernel will sync()450 filesystems during system suspend (after freezing user space451 and before suspending devices).452 453 Writing a "1" to this file enables the sync() and writing a "0"454 disables it. Reads from the file return the current value.455 The default is "1" if the build-time "SUSPEND_SKIP_SYNC" config456 flag is unset, or "0" otherwise.457