sysfs-power 12 KB

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