interface.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Power Management Interface
  2. The power management subsystem provides a unified sysfs interface to
  3. userspace, regardless of what architecture or platform one is
  4. running. The interface exists in /sys/power/ directory (assuming sysfs
  5. is mounted at /sys).
  6. /sys/power/state controls system power state. Reading from this file
  7. returns what states are supported, which is hard-coded to 'standby'
  8. (Power-On Suspend), 'mem' (Suspend-to-RAM), and 'disk'
  9. (Suspend-to-Disk).
  10. Writing to this file one of those strings causes the system to
  11. transition into that state. Please see the file
  12. Documentation/power/states.txt for a description of each of those
  13. states.
  14. /sys/power/disk controls the operating mode of the suspend-to-disk
  15. mechanism. Suspend-to-disk can be handled in several ways. The
  16. greatest distinction is who writes memory to disk - the firmware or
  17. the kernel. If the firmware does it, we assume that it also handles
  18. suspending the system.
  19. If the kernel does it, then we have three options for putting the system
  20. to sleep - using the platform driver (e.g. ACPI or other PM
  21. registers), powering off the system or rebooting the system (for
  22. testing). The system will support either 'firmware' or 'platform', and
  23. that is known a priori. But, the user may choose 'shutdown' or
  24. 'reboot' as alternatives.
  25. Reading from this file will display what the mode is currently set
  26. to. Writing to this file will accept one of
  27. 'firmware'
  28. 'platform'
  29. 'shutdown'
  30. 'reboot'
  31. It will only change to 'firmware' or 'platform' if the system supports
  32. it.
  33. /sys/power/image_size controls the size of the image created by
  34. the suspend-to-disk mechanism. It can be written a string
  35. representing a non-negative integer that will be used as an upper
  36. limit of the image size, in bytes. The suspend-to-disk mechanism will
  37. do its best to ensure the image size will not exceed that number. However,
  38. if this turns out to be impossible, it will try to suspend anyway using the
  39. smallest image possible. In particular, if "0" is written to this file, the
  40. suspend image will be as small as possible.
  41. Reading from this file will display the current image size limit, which
  42. is set to 500 MB by default.
  43. /sys/power/pm_trace controls the code which saves the last PM event point in
  44. the RTC across reboots, so that you can debug a machine that just hangs
  45. during suspend (or more commonly, during resume). Namely, the RTC is only
  46. used to save the last PM event point if this file contains '1'. Initially it
  47. contains '0' which may be changed to '1' by writing a string representing a
  48. nonzero integer into it.
  49. To use this debugging feature you should attempt to suspend the machine, then
  50. reboot it and run
  51. dmesg -s 1000000 | grep 'hash matches'
  52. CAUTION: Using it will cause your machine's real-time (CMOS) clock to be
  53. set to a random invalid time after a resume.