blob: 50f3ef9177c1b1b90896ddc0791acbd1bd21a95c [file] [log] [blame]
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +02001System Power Management Sleep States
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +02003(C) 2014 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +02005The kernel supports up to four system sleep states generically, although three
6of them depend on the platform support code to implement the low-level details
7for each state.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +02009The states are represented by strings that can be read or written to the
10/sys/power/state file. Those strings may be "mem", "standby", "freeze" and
11"disk", where the last one always represents hibernation (Suspend-To-Disk) and
12the meaning of the remaining ones depends on the relative_sleep_states command
13line argument.
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020015For relative_sleep_states=1, the strings "mem", "standby" and "freeze" label the
16available non-hibernation sleep states from the deepest to the shallowest,
17respectively. In that case, "mem" is always present in /sys/power/state,
18because there is at least one non-hibernation sleep state in every system. If
19the given system supports two non-hibernation sleep states, "standby" is present
20in /sys/power/state in addition to "mem". If the system supports three
21non-hibernation sleep states, "freeze" will be present in /sys/power/state in
22addition to "mem" and "standby".
23
24For relative_sleep_states=0, which is the default, the following descriptions
25apply.
26
27state: Suspend-To-Idle
Zhang Ruidc5aeae2013-05-13 02:42:11 +000028ACPI state: S0
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020029Label: "freeze"
Zhang Ruidc5aeae2013-05-13 02:42:11 +000030
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020031This state is a generic, pure software, light-weight, system sleep state.
32It allows more energy to be saved relative to runtime idle by freezing user
Zhang Ruidc5aeae2013-05-13 02:42:11 +000033space and putting all I/O devices into low-power states (possibly
34lower-power than available at run time), such that the processors can
35spend more time in their idle states.
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020036
37This state can be used for platforms without Power-On Suspend/Suspend-to-RAM
Zhang Ruidc5aeae2013-05-13 02:42:11 +000038support, or it can be used in addition to Suspend-to-RAM (memory sleep)
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020039to provide reduced resume latency. It is always supported.
Zhang Ruidc5aeae2013-05-13 02:42:11 +000040
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42State: Standby / Power-On Suspend
43ACPI State: S1
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020044Label: "standby"
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020046This state, if supported, offers moderate, though real, power savings, while
47providing a relatively low-latency transition back to a working system. No
48operating state is lost (the CPU retains power), so the system easily starts up
Linus Torvalds1da177e2005-04-16 15:20:36 -070049again where it left off.
50
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020051In addition to freezing user space and putting all I/O devices into low-power
52states, which is done for Suspend-To-Idle too, nonboot CPUs are taken offline
53and all low-level system functions are suspended during transitions into this
54state. For this reason, it should allow more energy to be saved relative to
55Suspend-To-Idle, but the resume latency will generally be greater than for that
56state.
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
59State: Suspend-to-RAM
60ACPI State: S3
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020061Label: "mem"
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020063This state, if supported, offers significant power savings as everything in the
64system is put into a low-power state, except for memory, which should be placed
65into the self-refresh mode to retain its contents. All of the steps carried out
66when entering Power-On Suspend are also carried out during transitions to STR.
67Additional operations may take place depending on the platform capabilities. In
68particular, on ACPI systems the kernel passes control to the BIOS (platform
69firmware) as the last step during STR transitions and that usually results in
70powering down some more low-level components that aren't directly controlled by
71the kernel.
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020073System and device state is saved and kept in memory. All devices are suspended
74and put into low-power states. In many cases, all peripheral buses lose power
75when entering STR, so devices must be able to handle the transition back to the
76"on" state.
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020078For at least ACPI, STR requires some minimal boot-strapping code to resume the
79system from it. This may be the case on other platforms too.
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
82State: Suspend-to-disk
83ACPI State: S4
Rafael J. Wysocki0399d4d2014-05-26 13:40:59 +020084Label: "disk"
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
86This state offers the greatest power savings, and can be used even in
87the absence of low-level platform support for power management. This
88state operates similarly to Suspend-to-RAM, but includes a final step
89of writing memory contents to disk. On resume, this is read and memory
90is restored to its pre-suspend state.
91
92STD can be handled by the firmware or the kernel. If it is handled by
93the firmware, it usually requires a dedicated partition that must be
94setup via another operating system for it to use. Despite the
95inconvenience, this method requires minimal work by the kernel, since
96the firmware will also handle restoring memory contents on resume.
97
Alexandre Courbota8b72282011-02-24 20:48:56 +010098For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
99to write memory contents to free swap space. swsusp has some restrictive
100requirements, but should work in most cases. Some, albeit outdated,
101documentation can be found in Documentation/power/swsusp.txt.
102Alternatively, userspace can do most of the actual suspend to disk work,
103see userland-swsusp.txt.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104
105Once memory state is written to disk, the system may either enter a
106low-power state (like ACPI S4), or it may simply power down. Powering
107down offers greater savings, and allows this mechanism to work on any
108system. However, entering a real low-power state allows the user to
Johannes Berg11d77d02007-04-30 15:09:53 -0700109trigger wake up events (e.g. pressing a key or opening a laptop lid).