Kconfig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. config SUSPEND
  3. bool "Suspend to RAM and standby"
  4. depends on ARCH_SUSPEND_POSSIBLE
  5. default y
  6. help
  7. Allow the system to enter sleep states in which main memory is
  8. powered and thus its contents are preserved, such as the
  9. suspend-to-RAM state (e.g. the ACPI S3 state).
  10. config SUSPEND_FREEZER
  11. bool "Enable freezer for suspend to RAM/standby" \
  12. if ARCH_WANTS_FREEZER_CONTROL || BROKEN
  13. depends on SUSPEND
  14. default y
  15. help
  16. This allows you to turn off the freezer for suspend. If this is
  17. done, no tasks are frozen for suspend to RAM/standby.
  18. Turning OFF this setting is NOT recommended! If in doubt, say Y.
  19. config SUSPEND_SKIP_SYNC
  20. bool "Skip kernel's sys_sync() on suspend to RAM/standby"
  21. depends on SUSPEND
  22. depends on EXPERT
  23. help
  24. Skip the kernel sys_sync() before freezing user processes.
  25. Some systems prefer not to pay this cost on every invocation
  26. of suspend, or they are content with invoking sync() from
  27. user-space before invoking suspend. There's a run-time switch
  28. at '/sys/power/sync_on_suspend' to configure this behaviour.
  29. This setting changes the default for the run-tim switch. Say Y
  30. to change the default to disable the kernel sys_sync().
  31. config HIBERNATE_CALLBACKS
  32. bool
  33. config HIBERNATION
  34. bool "Hibernation (aka 'suspend to disk')"
  35. depends on SWAP && ARCH_HIBERNATION_POSSIBLE
  36. select HIBERNATE_CALLBACKS
  37. select LZO_COMPRESS
  38. select LZO_DECOMPRESS
  39. select CRC32
  40. help
  41. Enable the suspend to disk (STD) functionality, which is usually
  42. called "hibernation" in user interfaces. STD checkpoints the
  43. system and powers it off; and restores that checkpoint on reboot.
  44. You can suspend your machine with 'echo disk > /sys/power/state'
  45. after placing resume=/dev/swappartition on the kernel command line
  46. in your bootloader's configuration file.
  47. Alternatively, you can use the additional userland tools available
  48. from <http://suspend.sf.net>.
  49. In principle it does not require ACPI or APM, although for example
  50. ACPI will be used for the final steps when it is available. One
  51. of the reasons to use software suspend is that the firmware hooks
  52. for suspend states like suspend-to-RAM (STR) often don't work very
  53. well with Linux.
  54. It creates an image which is saved in your active swap. Upon the next
  55. boot, pass the 'resume=/dev/swappartition' argument to the kernel to
  56. have it detect the saved image, restore memory state from it, and
  57. continue to run as before. If you do not want the previous state to
  58. be reloaded, then use the 'noresume' kernel command line argument.
  59. Note, however, that fsck will be run on your filesystems and you will
  60. need to run mkswap against the swap partition used for the suspend.
  61. It also works with swap files to a limited extent (for details see
  62. <file:Documentation/power/swsusp-and-swap-files.rst>).
  63. Right now you may boot without resuming and resume later but in the
  64. meantime you cannot use the swap partition(s)/file(s) involved in
  65. suspending. Also in this case you must not use the filesystems
  66. that were mounted before the suspend. In particular, you MUST NOT
  67. MOUNT any journaled filesystems mounted before the suspend or they
  68. will get corrupted in a nasty way.
  69. For more information take a look at <file:Documentation/power/swsusp.rst>.
  70. config HIBERNATION_SNAPSHOT_DEV
  71. bool "Userspace snapshot device"
  72. depends on HIBERNATION
  73. default y
  74. help
  75. Device used by the uswsusp tools.
  76. Say N if no snapshotting from userspace is needed, this also
  77. reduces the attack surface of the kernel.
  78. If in doubt, say Y.
  79. config PM_STD_PARTITION
  80. string "Default resume partition"
  81. depends on HIBERNATION
  82. default ""
  83. help
  84. The default resume partition is the partition that the suspend-
  85. to-disk implementation will look for a suspended disk image.
  86. The partition specified here will be different for almost every user.
  87. It should be a valid swap partition (at least for now) that is turned
  88. on before suspending.
  89. The partition specified can be overridden by specifying:
  90. resume=/dev/<other device>
  91. which will set the resume partition to the device specified.
  92. Note there is currently not a way to specify which device to save the
  93. suspended image to. It will simply pick the first available swap
  94. device.
  95. config PM_SLEEP
  96. def_bool y
  97. depends on SUSPEND || HIBERNATE_CALLBACKS
  98. select PM
  99. select SRCU
  100. config PM_SLEEP_SMP
  101. def_bool y
  102. depends on SMP
  103. depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
  104. depends on PM_SLEEP
  105. select HOTPLUG_CPU
  106. config PM_SLEEP_SMP_NONZERO_CPU
  107. def_bool y
  108. depends on PM_SLEEP_SMP
  109. depends on ARCH_SUSPEND_NONZERO_CPU
  110. help
  111. If an arch can suspend (for suspend, hibernate, kexec, etc) on a
  112. non-zero numbered CPU, it may define ARCH_SUSPEND_NONZERO_CPU. This
  113. will allow nohz_full mask to include CPU0.
  114. config PM_AUTOSLEEP
  115. bool "Opportunistic sleep"
  116. depends on PM_SLEEP
  117. default n
  118. help
  119. Allow the kernel to trigger a system transition into a global sleep
  120. state automatically whenever there are no active wakeup sources.
  121. config PM_WAKELOCKS
  122. bool "User space wakeup sources interface"
  123. depends on PM_SLEEP
  124. default n
  125. help
  126. Allow user space to create, activate and deactivate wakeup source
  127. objects with the help of a sysfs-based interface.
  128. config PM_WAKELOCKS_LIMIT
  129. int "Maximum number of user space wakeup sources (0 = no limit)"
  130. range 0 100000
  131. default 100
  132. depends on PM_WAKELOCKS
  133. config PM_WAKELOCKS_GC
  134. bool "Garbage collector for user space wakeup sources"
  135. depends on PM_WAKELOCKS
  136. default y
  137. config PM
  138. bool "Device power management core functionality"
  139. help
  140. Enable functionality allowing I/O devices to be put into energy-saving
  141. (low power) states, for example after a specified period of inactivity
  142. (autosuspended), and woken up in response to a hardware-generated
  143. wake-up event or a driver's request.
  144. Hardware support is generally required for this functionality to work
  145. and the bus type drivers of the buses the devices are on are
  146. responsible for the actual handling of device suspend requests and
  147. wake-up events.
  148. config PM_DEBUG
  149. bool "Power Management Debug Support"
  150. depends on PM
  151. help
  152. This option enables various debugging support in the Power Management
  153. code. This is helpful when debugging and reporting PM bugs, like
  154. suspend support.
  155. config PM_ADVANCED_DEBUG
  156. bool "Extra PM attributes in sysfs for low-level debugging/testing"
  157. depends on PM_DEBUG
  158. help
  159. Add extra sysfs attributes allowing one to access some Power Management
  160. fields of device objects from user space. If you are not a kernel
  161. developer interested in debugging/testing Power Management, say "no".
  162. config PM_TEST_SUSPEND
  163. bool "Test suspend/resume and wakealarm during bootup"
  164. depends on SUSPEND && PM_DEBUG && RTC_CLASS=y
  165. help
  166. This option will let you suspend your machine during bootup, and
  167. make it wake up a few seconds later using an RTC wakeup alarm.
  168. Enable this with a kernel parameter like "test_suspend=mem".
  169. You probably want to have your system's RTC driver statically
  170. linked, ensuring that it's available when this test runs.
  171. config PM_SLEEP_DEBUG
  172. def_bool y
  173. depends on PM_DEBUG && PM_SLEEP
  174. config DPM_WATCHDOG
  175. bool "Device suspend/resume watchdog"
  176. depends on PM_DEBUG && PSTORE && EXPERT
  177. help
  178. Sets up a watchdog timer to capture drivers that are
  179. locked up attempting to suspend/resume a device.
  180. A detected lockup causes system panic with message
  181. captured in pstore device for inspection in subsequent
  182. boot session.
  183. config DPM_WATCHDOG_TIMEOUT
  184. int "Watchdog timeout in seconds"
  185. range 1 120
  186. default 120
  187. depends on DPM_WATCHDOG
  188. config PM_TRACE
  189. bool
  190. help
  191. This enables code to save the last PM event point across
  192. reboot. The architecture needs to support this, x86 for
  193. example does by saving things in the RTC, see below.
  194. The architecture specific code must provide the extern
  195. functions from <linux/resume-trace.h> as well as the
  196. <asm/resume-trace.h> header with a TRACE_RESUME() macro.
  197. The way the information is presented is architecture-
  198. dependent, x86 will print the information during a
  199. late_initcall.
  200. config PM_TRACE_RTC
  201. bool "Suspend/resume event tracing"
  202. depends on PM_SLEEP_DEBUG
  203. depends on X86
  204. select PM_TRACE
  205. help
  206. This enables some cheesy code to save the last PM event point in the
  207. RTC across reboots, so that you can debug a machine that just hangs
  208. during suspend (or more commonly, during resume).
  209. To use this debugging feature you should attempt to suspend the
  210. machine, reboot it and then run
  211. dmesg -s 1000000 | grep 'hash matches'
  212. CAUTION: this option will cause your machine's real-time clock to be
  213. set to an invalid time after a resume.
  214. config APM_EMULATION
  215. tristate "Advanced Power Management Emulation"
  216. depends on SYS_SUPPORTS_APM_EMULATION
  217. help
  218. APM is a BIOS specification for saving power using several different
  219. techniques. This is mostly useful for battery powered laptops with
  220. APM compliant BIOSes. If you say Y here, the system time will be
  221. reset after a RESUME operation, the /proc/apm device will provide
  222. battery status information, and user-space programs will receive
  223. notification of APM "events" (e.g. battery status change).
  224. In order to use APM, you will need supporting software. For location
  225. and more information, read <file:Documentation/power/apm-acpi.rst>
  226. and the Battery Powered Linux mini-HOWTO, available from
  227. <http://www.tldp.org/docs.html#howto>.
  228. This driver does not spin down disk drives (see the hdparm(8)
  229. manpage ("man 8 hdparm") for that), and it doesn't turn off
  230. VESA-compliant "green" monitors.
  231. Generally, if you don't have a battery in your machine, there isn't
  232. much point in using this driver and you should say N. If you get
  233. random kernel OOPSes or reboots that don't seem to be related to
  234. anything, try disabling/enabling this option (or disabling/enabling
  235. APM in your BIOS).
  236. config PM_CLK
  237. def_bool y
  238. depends on PM && HAVE_CLK
  239. config PM_GENERIC_DOMAINS
  240. bool
  241. depends on PM
  242. config WQ_POWER_EFFICIENT_DEFAULT
  243. bool "Enable workqueue power-efficient mode by default"
  244. depends on PM
  245. default n
  246. help
  247. Per-cpu workqueues are generally preferred because they show
  248. better performance thanks to cache locality; unfortunately,
  249. per-cpu workqueues tend to be more power hungry than unbound
  250. workqueues.
  251. Enabling workqueue.power_efficient kernel parameter makes the
  252. per-cpu workqueues which were observed to contribute
  253. significantly to power consumption unbound, leading to measurably
  254. lower power usage at the cost of small performance overhead.
  255. This config option determines whether workqueue.power_efficient
  256. is enabled by default.
  257. If in doubt, say N.
  258. config PM_GENERIC_DOMAINS_SLEEP
  259. def_bool y
  260. depends on PM_SLEEP && PM_GENERIC_DOMAINS
  261. config PM_GENERIC_DOMAINS_OF
  262. def_bool y
  263. depends on PM_GENERIC_DOMAINS && OF
  264. config CPU_PM
  265. bool
  266. config ENERGY_MODEL
  267. bool "Energy Model for CPUs"
  268. depends on SMP
  269. depends on CPU_FREQ
  270. default n
  271. help
  272. Several subsystems (thermal and/or the task scheduler for example)
  273. can leverage information about the energy consumed by CPUs to make
  274. smarter decisions. This config option enables the framework from
  275. which subsystems can access the energy models.
  276. The exact usage of the energy model is subsystem-dependent.
  277. If in doubt, say N.