interface.txt 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Power Management Interface for System Sleep
  2. Copyright (c) 2016 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  3. The power management subsystem provides userspace with a unified sysfs interface
  4. for system sleep regardless of the underlying system architecture or platform.
  5. The interface is located in the /sys/power/ directory (assuming that sysfs is
  6. mounted at /sys).
  7. /sys/power/state is the system sleep state control file.
  8. Reading from it returns a list of supported sleep states, encoded as:
  9. 'freeze' (Suspend-to-Idle)
  10. 'standby' (Power-On Suspend)
  11. 'mem' (Suspend-to-RAM)
  12. 'disk' (Suspend-to-Disk)
  13. Suspend-to-Idle is always supported. Suspend-to-Disk is always supported
  14. too as long the kernel has been configured to support hibernation at all
  15. (ie. CONFIG_HIBERNATION is set in the kernel configuration file). Support
  16. for Suspend-to-RAM and Power-On Suspend depends on the capabilities of the
  17. platform.
  18. If one of the strings listed in /sys/power/state is written to it, the system
  19. will attempt to transition into the corresponding sleep state. Refer to
  20. Documentation/power/states.txt for a description of each of those states.
  21. /sys/power/disk controls the operating mode of hibernation (Suspend-to-Disk).
  22. Specifically, it tells the kernel what to do after creating a hibernation image.
  23. Reading from it returns a list of supported options encoded as:
  24. 'platform' (put the system into sleep using a platform-provided method)
  25. 'shutdown' (shut the system down)
  26. 'reboot' (reboot the system)
  27. 'suspend' (trigger a Suspend-to-RAM transition)
  28. 'test_resume' (resume-after-hibernation test mode)
  29. The currently selected option is printed in square brackets.
  30. The 'platform' option is only available if the platform provides a special
  31. mechanism to put the system to sleep after creating a hibernation image (ACPI
  32. does that, for example). The 'suspend' option is available if Suspend-to-RAM
  33. is supported. Refer to Documentation/power/basic_pm_debugging.txt for the
  34. description of the 'test_resume' option.
  35. To select an option, write the string representing it to /sys/power/disk.
  36. /sys/power/image_size controls the size of hibernation images.
  37. It can be written a string representing a non-negative integer that will be
  38. used as a best-effort upper limit of the image size, in bytes. The hibernation
  39. core will do its best to ensure that the image size will not exceed that number.
  40. However, if that turns out to be impossible to achieve, a hibernation image will
  41. still be created and its size will be as small as possible. In particular,
  42. writing '0' to this file will enforce hibernation images to be as small as
  43. possible.
  44. Reading from this file returns the current image size limit, which is set to
  45. around 2/5 of available RAM by default.
  46. /sys/power/pm_trace controls the PM trace mechanism saving the last suspend
  47. or resume event point in the RTC across reboots.
  48. It helps to debug hard lockups or reboots due to device driver failures that
  49. occur during system suspend or resume (which is more common) more effectively.
  50. If /sys/power/pm_trace contains '1', the fingerprint of each suspend/resume
  51. event point in turn will be stored in the RTC memory (overwriting the actual
  52. RTC information), so it will survive a system crash if one occurs right after
  53. storing it and it can be used later to identify the driver that caused the crash
  54. to happen (see Documentation/power/s2ram.txt for more information).
  55. Initially it contains '0' which may be changed to '1' by writing a string
  56. representing a nonzero integer into it.