Back to home page

OSCL-LXR

 
 

    


0001 What:           /sys/power/
0002 Date:           August 2006
0003 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0004 Description:
0005                 The /sys/power directory will contain files that will
0006                 provide a unified interface to the power management
0007                 subsystem.
0008 
0009 What:           /sys/power/state
0010 Date:           November 2016
0011 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0012 Description:
0013                 The /sys/power/state file controls system sleep states.
0014                 Reading from this file returns the available sleep state
0015                 labels, which may be "mem" (suspend), "standby" (power-on
0016                 suspend), "freeze" (suspend-to-idle) and "disk" (hibernation).
0017 
0018                 Writing one of the above strings to this file causes the system
0019                 to transition into the corresponding state, if available.
0020 
0021                 See Documentation/admin-guide/pm/sleep-states.rst for more
0022                 information.
0023 
0024 What:           /sys/power/mem_sleep
0025 Date:           November 2016
0026 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0027 Description:
0028                 The /sys/power/mem_sleep file controls the operating mode of
0029                 system suspend.  Reading from it returns the available modes
0030                 as "s2idle" (always present), "shallow" and "deep" (present if
0031                 supported).  The mode that will be used on subsequent attempts
0032                 to suspend the system (by writing "mem" to the /sys/power/state
0033                 file described above) is enclosed in square brackets.
0034 
0035                 Writing one of the above strings to this file causes the mode
0036                 represented by it to be used on subsequent attempts to suspend
0037                 the system.
0038 
0039                 See Documentation/admin-guide/pm/sleep-states.rst for more
0040                 information.
0041 
0042 What:           /sys/power/disk
0043 Date:           September 2006
0044 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0045 Description:
0046                 The /sys/power/disk file controls the operating mode of the
0047                 suspend-to-disk mechanism.  Reading from this file returns
0048                 the name of the method by which the system will be put to
0049                 sleep on the next suspend.  There are four methods supported:
0050 
0051                 'firmware' - means that the memory image will be saved to disk
0052                 by some firmware, in which case we also assume that the
0053                 firmware will handle the system suspend.
0054 
0055                 'platform' - the memory image will be saved by the kernel and
0056                 the system will be put to sleep by the platform driver (e.g.
0057                 ACPI or other PM registers).
0058 
0059                 'shutdown' - the memory image will be saved by the kernel and
0060                 the system will be powered off.
0061 
0062                 'reboot' - the memory image will be saved by the kernel and
0063                 the system will be rebooted.
0064 
0065                 Additionally, /sys/power/disk can be used to turn on one of the
0066                 two testing modes of the suspend-to-disk mechanism: 'testproc'
0067                 or 'test'.  If the suspend-to-disk mechanism is in the
0068                 'testproc' mode, writing 'disk' to /sys/power/state will cause
0069                 the kernel to disable nonboot CPUs and freeze tasks, wait for 5
0070                 seconds, unfreeze tasks and enable nonboot CPUs.  If it is in
0071                 the 'test' mode, writing 'disk' to /sys/power/state will cause
0072                 the kernel to disable nonboot CPUs and freeze tasks, shrink
0073                 memory, suspend devices, wait for 5 seconds, resume devices,
0074                 unfreeze tasks and enable nonboot CPUs.  Then, we are able to
0075                 look in the log messages and work out, for example, which code
0076                 is being slow and which device drivers are misbehaving.
0077 
0078                 The suspend-to-disk method may be chosen by writing to this
0079                 file one of the accepted strings:
0080 
0081                 - 'firmware'
0082                 - 'platform'
0083                 - 'shutdown'
0084                 - 'reboot'
0085                 - 'testproc'
0086                 - 'test'
0087 
0088                 It will only change to 'firmware' or 'platform' if the system
0089                 supports that.
0090 
0091 What:           /sys/power/image_size
0092 Date:           August 2006
0093 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0094 Description:
0095                 The /sys/power/image_size file controls the size of the image
0096                 created by the suspend-to-disk mechanism.  It can be written a
0097                 string representing a non-negative integer that will be used
0098                 as an upper limit of the image size, in bytes.  The kernel's
0099                 suspend-to-disk code will do its best to ensure the image size
0100                 will not exceed this number.  However, if it turns out to be
0101                 impossible, the kernel will try to suspend anyway using the
0102                 smallest image possible.  In particular, if "0" is written to
0103                 this file, the suspend image will be as small as possible.
0104 
0105                 Reading from this file will display the current image size
0106                 limit, which is set to around 2/5 of available RAM by default.
0107 
0108 What:           /sys/power/pm_trace
0109 Date:           August 2006
0110 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0111 Description:
0112                 The /sys/power/pm_trace file controls the code which saves the
0113                 last PM event point in the RTC across reboots, so that you can
0114                 debug a machine that just hangs during suspend (or more
0115                 commonly, during resume).  Namely, the RTC is only used to save
0116                 the last PM event point if this file contains '1'.  Initially
0117                 it contains '0' which may be changed to '1' by writing a
0118                 string representing a nonzero integer into it.
0119 
0120                 To use this debugging feature you should attempt to suspend
0121                 the machine, then reboot it and run::
0122 
0123                   dmesg -s 1000000 | grep 'hash matches'
0124 
0125                 If you do not get any matches (or they appear to be false
0126                 positives), it is possible that the last PM event point
0127                 referred to a device created by a loadable kernel module.  In
0128                 this case cat /sys/power/pm_trace_dev_match (see below) after
0129                 your system is started up and the kernel modules are loaded.
0130 
0131                 CAUTION: Using it will cause your machine's real-time (CMOS)
0132                 clock to be set to a random invalid time after a resume.
0133 
0134 What;           /sys/power/pm_trace_dev_match
0135 Date:           October 2010
0136 Contact:        James Hogan <jhogan@kernel.org>
0137 Description:
0138                 The /sys/power/pm_trace_dev_match file contains the name of the
0139                 device associated with the last PM event point saved in the RTC
0140                 across reboots when pm_trace has been used.  More precisely it
0141                 contains the list of current devices (including those
0142                 registered by loadable kernel modules since boot) which match
0143                 the device hash in the RTC at boot, with a newline after each
0144                 one.
0145 
0146                 The advantage of this file over the hash matches printed to the
0147                 kernel log (see /sys/power/pm_trace), is that it includes
0148                 devices created after boot by loadable kernel modules.
0149 
0150                 Due to the small hash size necessary to fit in the RTC, it is
0151                 possible that more than one device matches the hash, in which
0152                 case further investigation is required to determine which
0153                 device is causing the problem.  Note that genuine RTC clock
0154                 values (such as when pm_trace has not been used), can still
0155                 match a device and output it's name here.
0156 
0157 What:           /sys/power/pm_async
0158 Date:           January 2009
0159 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0160 Description:
0161                 The /sys/power/pm_async file controls the switch allowing the
0162                 user space to enable or disable asynchronous suspend and resume
0163                 of devices.  If enabled, this feature will cause some device
0164                 drivers' suspend and resume callbacks to be executed in parallel
0165                 with each other and with the main suspend thread.  It is enabled
0166                 if this file contains "1", which is the default.  It may be
0167                 disabled by writing "0" to this file, in which case all devices
0168                 will be suspended and resumed synchronously.
0169 
0170 What:           /sys/power/wakeup_count
0171 Date:           July 2010
0172 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0173 Description:
0174                 The /sys/power/wakeup_count file allows user space to put the
0175                 system into a sleep state while taking into account the
0176                 concurrent arrival of wakeup events.  Reading from it returns
0177                 the current number of registered wakeup events and it blocks if
0178                 some wakeup events are being processed at the time the file is
0179                 read from.  Writing to it will only succeed if the current
0180                 number of wakeup events is equal to the written value and, if
0181                 successful, will make the kernel abort a subsequent transition
0182                 to a sleep state if any wakeup events are reported after the
0183                 write has returned.
0184 
0185 What:           /sys/power/reserved_size
0186 Date:           May 2011
0187 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0188 Description:
0189                 The /sys/power/reserved_size file allows user space to control
0190                 the amount of memory reserved for allocations made by device
0191                 drivers during the "device freeze" stage of hibernation.  It can
0192                 be written a string representing a non-negative integer that
0193                 will be used as the amount of memory to reserve for allocations
0194                 made by device drivers' "freeze" callbacks, in bytes.
0195 
0196                 Reading from this file will display the current value, which is
0197                 set to 1 MB by default.
0198 
0199 What:           /sys/power/autosleep
0200 Date:           April 2012
0201 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0202 Description:
0203                 The /sys/power/autosleep file can be written one of the strings
0204                 returned by reads from /sys/power/state.  If that happens, a
0205                 work item attempting to trigger a transition of the system to
0206                 the sleep state represented by that string is queued up.  This
0207                 attempt will only succeed if there are no active wakeup sources
0208                 in the system at that time.  After every execution, regardless
0209                 of whether or not the attempt to put the system to sleep has
0210                 succeeded, the work item requeues itself until user space
0211                 writes "off" to /sys/power/autosleep.
0212 
0213                 Reading from this file causes the last string successfully
0214                 written to it to be returned.
0215 
0216 What:           /sys/power/wake_lock
0217 Date:           February 2012
0218 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0219 Description:
0220                 The /sys/power/wake_lock file allows user space to create
0221                 wakeup source objects and activate them on demand (if one of
0222                 those wakeup sources is active, reads from the
0223                 /sys/power/wakeup_count file block or return false).  When a
0224                 string without white space is written to /sys/power/wake_lock,
0225                 it will be assumed to represent a wakeup source name.  If there
0226                 is a wakeup source object with that name, it will be activated
0227                 (unless active already).  Otherwise, a new wakeup source object
0228                 will be registered, assigned the given name and activated.
0229                 If a string written to /sys/power/wake_lock contains white
0230                 space, the part of the string preceding the white space will be
0231                 regarded as a wakeup source name and handled as descrived above.
0232                 The other part of the string will be regarded as a timeout (in
0233                 nanoseconds) such that the wakeup source will be automatically
0234                 deactivated after it has expired.  The timeout, if present, is
0235                 set regardless of the current state of the wakeup source object
0236                 in question.
0237 
0238                 Reads from this file return a string consisting of the names of
0239                 wakeup sources created with the help of it that are active at
0240                 the moment, separated with spaces.
0241 
0242 
0243 What:           /sys/power/wake_unlock
0244 Date:           February 2012
0245 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0246 Description:
0247                 The /sys/power/wake_unlock file allows user space to deactivate
0248                 wakeup sources created with the help of /sys/power/wake_lock.
0249                 When a string is written to /sys/power/wake_unlock, it will be
0250                 assumed to represent the name of a wakeup source to deactivate.
0251 
0252                 If a wakeup source object of that name exists and is active at
0253                 the moment, it will be deactivated.
0254 
0255                 Reads from this file return a string consisting of the names of
0256                 wakeup sources created with the help of /sys/power/wake_lock
0257                 that are inactive at the moment, separated with spaces.
0258 
0259 What:           /sys/power/pm_print_times
0260 Date:           May 2012
0261 Contact:        Sameer Nanda <snanda@chromium.org>
0262 Description:
0263                 The /sys/power/pm_print_times file allows user space to
0264                 control whether the time taken by devices to suspend and
0265                 resume is printed.  These prints are useful for hunting down
0266                 devices that take too long to suspend or resume.
0267 
0268                 Writing a "1" enables this printing while writing a "0"
0269                 disables it.  The default value is "0".  Reading from this file
0270                 will display the current value.
0271 
0272 What:           /sys/power/pm_wakeup_irq
0273 Date:           April 2015
0274 Contact:        Alexandra Yates <alexandra.yates@linux.intel.org>
0275 Description:
0276                 The /sys/power/pm_wakeup_irq file reports to user space the IRQ
0277                 number of the first wakeup interrupt (that is, the first
0278                 interrupt from an IRQ line armed for system wakeup) seen by the
0279                 kernel during the most recent system suspend/resume cycle.
0280 
0281                 This output is useful for system wakeup diagnostics of spurious
0282                 wakeup interrupts.
0283 
0284 What:           /sys/power/pm_debug_messages
0285 Date:           July 2017
0286 Contact:        Rafael J. Wysocki <rjw@rjwysocki.net>
0287 Description:
0288                 The /sys/power/pm_debug_messages file controls the printing
0289                 of debug messages from the system suspend/hiberbation
0290                 infrastructure to the kernel log.
0291 
0292                 Writing a "1" to this file enables the debug messages and
0293                 writing a "0" (default) to it disables them.  Reads from
0294                 this file return the current value.
0295 
0296 What:           /sys/power/resume_offset
0297 Date:           April 2018
0298 Contact:        Mario Limonciello <mario.limonciello@outlook.com>
0299 Description:
0300                 This file is used for telling the kernel an offset into a disk
0301                 to use when hibernating the system such as with a swap file.
0302 
0303                 Reads from this file will display the current offset
0304                 the kernel will be using on the next hibernation
0305                 attempt.
0306 
0307                 Using this sysfs file will override any values that were
0308                 set using the kernel command line for disk offset.
0309 
0310 What:           /sys/power/suspend_stats
0311 Date:           July 2019
0312 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0313 Description:
0314                 The /sys/power/suspend_stats directory contains suspend related
0315                 statistics.
0316 
0317 What:           /sys/power/suspend_stats/success
0318 Date:           July 2019
0319 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0320 Description:
0321                 The /sys/power/suspend_stats/success file contains the number
0322                 of times entering system sleep state succeeded.
0323 
0324 What:           /sys/power/suspend_stats/fail
0325 Date:           July 2019
0326 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0327 Description:
0328                 The /sys/power/suspend_stats/fail file contains the number
0329                 of times entering system sleep state failed.
0330 
0331 What:           /sys/power/suspend_stats/failed_freeze
0332 Date:           July 2019
0333 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0334 Description:
0335                 The /sys/power/suspend_stats/failed_freeze file contains the
0336                 number of times freezing processes failed.
0337 
0338 What:           /sys/power/suspend_stats/failed_prepare
0339 Date:           July 2019
0340 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0341 Description:
0342                 The /sys/power/suspend_stats/failed_prepare file contains the
0343                 number of times preparing all non-sysdev devices for
0344                 a system PM transition failed.
0345 
0346 What:           /sys/power/suspend_stats/failed_resume
0347 Date:           July 2019
0348 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0349 Description:
0350                 The /sys/power/suspend_stats/failed_resume file contains the
0351                 number of times executing "resume" callbacks of
0352                 non-sysdev devices failed.
0353 
0354 What:           /sys/power/suspend_stats/failed_resume_early
0355 Date:           July 2019
0356 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0357 Description:
0358                 The /sys/power/suspend_stats/failed_resume_early file contains
0359                 the number of times executing "early resume" callbacks
0360                 of devices failed.
0361 
0362 What:           /sys/power/suspend_stats/failed_resume_noirq
0363 Date:           July 2019
0364 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0365 Description:
0366                 The /sys/power/suspend_stats/failed_resume_noirq file contains
0367                 the number of times executing "noirq resume" callbacks
0368                 of devices failed.
0369 
0370 What:           /sys/power/suspend_stats/failed_suspend
0371 Date:           July 2019
0372 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0373 Description:
0374                 The /sys/power/suspend_stats/failed_suspend file contains
0375                 the number of times executing "suspend" callbacks
0376                 of all non-sysdev devices failed.
0377 
0378 What:           /sys/power/suspend_stats/failed_suspend_late
0379 Date:           July 2019
0380 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0381 Description:
0382                 The /sys/power/suspend_stats/failed_suspend_late file contains
0383                 the number of times executing "late suspend" callbacks
0384                 of all devices failed.
0385 
0386 What:           /sys/power/suspend_stats/failed_suspend_noirq
0387 Date:           July 2019
0388 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0389 Description:
0390                 The /sys/power/suspend_stats/failed_suspend_noirq file contains
0391                 the number of times executing "noirq suspend" callbacks
0392                 of all devices failed.
0393 
0394 What:           /sys/power/suspend_stats/last_failed_dev
0395 Date:           July 2019
0396 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0397 Description:
0398                 The /sys/power/suspend_stats/last_failed_dev file contains
0399                 the last device for which a suspend/resume callback failed.
0400 
0401 What:           /sys/power/suspend_stats/last_failed_errno
0402 Date:           July 2019
0403 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0404 Description:
0405                 The /sys/power/suspend_stats/last_failed_errno file contains
0406                 the errno of the last failed attempt at entering
0407                 system sleep state.
0408 
0409 What:           /sys/power/suspend_stats/last_failed_step
0410 Date:           July 2019
0411 Contact:        Kalesh Singh <kaleshsingh96@gmail.com>
0412 Description:
0413                 The /sys/power/suspend_stats/last_failed_step file contains
0414                 the last failed step in the suspend/resume path.
0415 
0416 What:           /sys/power/sync_on_suspend
0417 Date:           October 2019
0418 Contact:        Jonas Meurer <jonas@freesources.org>
0419 Description:
0420                 This file controls whether or not the kernel will sync()
0421                 filesystems during system suspend (after freezing user space
0422                 and before suspending devices).
0423 
0424                 Writing a "1" to this file enables the sync() and writing a "0"
0425                 disables it.  Reads from the file return the current value.
0426                 The default is "1" if the build-time "SUSPEND_SKIP_SYNC" config
0427                 flag is unset, or "0" otherwise.