sysfs-power 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. What: /sys/power/
  2. Date: August 2006
  3. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  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: August 2006
  10. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  11. Description:
  12. The /sys/power/state file controls the system power state.
  13. Reading from this file returns what states are supported,
  14. which is hard-coded to 'standby' (Power-On Suspend), 'mem'
  15. (Suspend-to-RAM), and 'disk' (Suspend-to-Disk).
  16. Writing to this file one of these strings causes the system to
  17. transition into that state. Please see the file
  18. Documentation/power/states.txt for a description of each of
  19. these states.
  20. What: /sys/power/disk
  21. Date: September 2006
  22. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  23. Description:
  24. The /sys/power/disk file controls the operating mode of the
  25. suspend-to-disk mechanism. Reading from this file returns
  26. the name of the method by which the system will be put to
  27. sleep on the next suspend. There are four methods supported:
  28. 'firmware' - means that the memory image will be saved to disk
  29. by some firmware, in which case we also assume that the
  30. firmware will handle the system suspend.
  31. 'platform' - the memory image will be saved by the kernel and
  32. the system will be put to sleep by the platform driver (e.g.
  33. ACPI or other PM registers).
  34. 'shutdown' - the memory image will be saved by the kernel and
  35. the system will be powered off.
  36. 'reboot' - the memory image will be saved by the kernel and
  37. the system will be rebooted.
  38. Additionally, /sys/power/disk can be used to turn on one of the
  39. two testing modes of the suspend-to-disk mechanism: 'testproc'
  40. or 'test'. If the suspend-to-disk mechanism is in the
  41. 'testproc' mode, writing 'disk' to /sys/power/state will cause
  42. the kernel to disable nonboot CPUs and freeze tasks, wait for 5
  43. seconds, unfreeze tasks and enable nonboot CPUs. If it is in
  44. the 'test' mode, writing 'disk' to /sys/power/state will cause
  45. the kernel to disable nonboot CPUs and freeze tasks, shrink
  46. memory, suspend devices, wait for 5 seconds, resume devices,
  47. unfreeze tasks and enable nonboot CPUs. Then, we are able to
  48. look in the log messages and work out, for example, which code
  49. is being slow and which device drivers are misbehaving.
  50. The suspend-to-disk method may be chosen by writing to this
  51. file one of the accepted strings:
  52. 'firmware'
  53. 'platform'
  54. 'shutdown'
  55. 'reboot'
  56. 'testproc'
  57. 'test'
  58. It will only change to 'firmware' or 'platform' if the system
  59. supports that.
  60. What: /sys/power/image_size
  61. Date: August 2006
  62. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  63. Description:
  64. The /sys/power/image_size file controls the size of the image
  65. created by the suspend-to-disk mechanism. It can be written a
  66. string representing a non-negative integer that will be used
  67. as an upper limit of the image size, in bytes. The kernel's
  68. suspend-to-disk code will do its best to ensure the image size
  69. will not exceed this number. However, if it turns out to be
  70. impossible, the kernel will try to suspend anyway using the
  71. smallest image possible. In particular, if "0" is written to
  72. this file, the suspend image will be as small as possible.
  73. Reading from this file will display the current image size
  74. limit, which is set to 500 MB by default.
  75. What: /sys/power/pm_trace
  76. Date: August 2006
  77. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  78. Description:
  79. The /sys/power/pm_trace file controls the code which saves the
  80. last PM event point in the RTC across reboots, so that you can
  81. debug a machine that just hangs during suspend (or more
  82. commonly, during resume). Namely, the RTC is only used to save
  83. the last PM event point if this file contains '1'. Initially
  84. it contains '0' which may be changed to '1' by writing a
  85. string representing a nonzero integer into it.
  86. To use this debugging feature you should attempt to suspend
  87. the machine, then reboot it and run
  88. dmesg -s 1000000 | grep 'hash matches'
  89. CAUTION: Using it will cause your machine's real-time (CMOS)
  90. clock to be set to a random invalid time after a resume.
  91. What: /sys/power/pm_async
  92. Date: January 2009
  93. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  94. Description:
  95. The /sys/power/pm_async file controls the switch allowing the
  96. user space to enable or disable asynchronous suspend and resume
  97. of devices. If enabled, this feature will cause some device
  98. drivers' suspend and resume callbacks to be executed in parallel
  99. with each other and with the main suspend thread. It is enabled
  100. if this file contains "1", which is the default. It may be
  101. disabled by writing "0" to this file, in which case all devices
  102. will be suspended and resumed synchronously.
  103. What: /sys/power/wakeup_count
  104. Date: July 2010
  105. Contact: Rafael J. Wysocki <rjw@sisk.pl>
  106. Description:
  107. The /sys/power/wakeup_count file allows user space to put the
  108. system into a sleep state while taking into account the
  109. concurrent arrival of wakeup events. Reading from it returns
  110. the current number of registered wakeup events and it blocks if
  111. some wakeup events are being processed at the time the file is
  112. read from. Writing to it will only succeed if the current
  113. number of wakeup events is equal to the written value and, if
  114. successful, will make the kernel abort a subsequent transition
  115. to a sleep state if any wakeup events are reported after the
  116. write has returned.