Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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 CRC32
  38. select CRYPTO
  39. select CRYPTO_LZO
  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. choice
  80. prompt "Default compressor"
  81. default HIBERNATION_COMP_LZO
  82. depends on HIBERNATION
  83. config HIBERNATION_COMP_LZO
  84. bool "lzo"
  85. depends on CRYPTO_LZO
  86. config HIBERNATION_COMP_LZ4
  87. bool "lz4"
  88. depends on CRYPTO_LZ4
  89. endchoice
  90. config HIBERNATION_DEF_COMP
  91. string
  92. default "lzo" if HIBERNATION_COMP_LZO
  93. default "lz4" if HIBERNATION_COMP_LZ4
  94. help
  95. Default compressor to be used for hibernation.
  96. config PM_STD_PARTITION
  97. string "Default resume partition"
  98. depends on HIBERNATION
  99. default ""
  100. help
  101. The default resume partition is the partition that the suspend-
  102. to-disk implementation will look for a suspended disk image.
  103. The partition specified here will be different for almost every user.
  104. It should be a valid swap partition (at least for now) that is turned
  105. on before suspending.
  106. The partition specified can be overridden by specifying:
  107. resume=/dev/<other device>
  108. which will set the resume partition to the device specified.
  109. Note there is currently not a way to specify which device to save the
  110. suspended image to. It will simply pick the first available swap
  111. device.
  112. config PM_SLEEP
  113. def_bool y
  114. depends on SUSPEND || HIBERNATE_CALLBACKS
  115. select PM
  116. config PM_SLEEP_SMP
  117. def_bool y
  118. depends on SMP
  119. depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
  120. depends on PM_SLEEP
  121. select HOTPLUG_CPU
  122. config PM_SLEEP_SMP_NONZERO_CPU
  123. def_bool y
  124. depends on PM_SLEEP_SMP
  125. depends on ARCH_SUSPEND_NONZERO_CPU
  126. help
  127. If an arch can suspend (for suspend, hibernate, kexec, etc) on a
  128. non-zero numbered CPU, it may define ARCH_SUSPEND_NONZERO_CPU. This
  129. will allow nohz_full mask to include CPU0.
  130. config PM_AUTOSLEEP
  131. bool "Opportunistic sleep"
  132. depends on PM_SLEEP
  133. help
  134. Allow the kernel to trigger a system transition into a global sleep
  135. state automatically whenever there are no active wakeup sources.
  136. config PM_USERSPACE_AUTOSLEEP
  137. bool "Userspace opportunistic sleep"
  138. depends on PM_SLEEP
  139. help
  140. Notify kernel of aggressive userspace autosleep power management policy.
  141. This option changes the behavior of various sleep-sensitive code to deal
  142. with frequent userspace-initiated transitions into a global sleep state.
  143. Saying Y here, disables code paths that most users really should keep
  144. enabled. In particular, only enable this if it is very common to be
  145. asleep/awake for very short periods of time (<= 2 seconds).
  146. Only platforms, such as Android, that implement opportunistic sleep from
  147. a userspace power manager service should enable this option; and not
  148. other machines. Therefore, you should say N here, unless you are
  149. extremely certain that this is what you want. The option otherwise has
  150. bad, undesirable effects, and should not be enabled just for fun.
  151. config PM_WAKELOCKS
  152. bool "User space wakeup sources interface"
  153. depends on PM_SLEEP
  154. help
  155. Allow user space to create, activate and deactivate wakeup source
  156. objects with the help of a sysfs-based interface.
  157. config PM_WAKELOCKS_LIMIT
  158. int "Maximum number of user space wakeup sources (0 = no limit)"
  159. range 0 100000
  160. default 100
  161. depends on PM_WAKELOCKS
  162. config PM_WAKELOCKS_GC
  163. bool "Garbage collector for user space wakeup sources"
  164. depends on PM_WAKELOCKS
  165. default y
  166. config PM
  167. bool "Device power management core functionality"
  168. help
  169. Enable functionality allowing I/O devices to be put into energy-saving
  170. (low power) states, for example after a specified period of inactivity
  171. (autosuspended), and woken up in response to a hardware-generated
  172. wake-up event or a driver's request.
  173. Hardware support is generally required for this functionality to work
  174. and the bus type drivers of the buses the devices are on are
  175. responsible for the actual handling of device suspend requests and
  176. wake-up events.
  177. config PM_DEBUG
  178. bool "Power Management Debug Support"
  179. depends on PM
  180. help
  181. This option enables various debugging support in the Power Management
  182. code. This is helpful when debugging and reporting PM bugs, like
  183. suspend support.
  184. config PM_ADVANCED_DEBUG
  185. bool "Extra PM attributes in sysfs for low-level debugging/testing"
  186. depends on PM_DEBUG
  187. help
  188. Add extra sysfs attributes allowing one to access some Power Management
  189. fields of device objects from user space. If you are not a kernel
  190. developer interested in debugging/testing Power Management, say "no".
  191. config PM_TEST_SUSPEND
  192. bool "Test suspend/resume and wakealarm during bootup"
  193. depends on SUSPEND && PM_DEBUG && RTC_CLASS=y
  194. help
  195. This option will let you suspend your machine during bootup, and
  196. make it wake up a few seconds later using an RTC wakeup alarm.
  197. Enable this with a kernel parameter like "test_suspend=mem".
  198. You probably want to have your system's RTC driver statically
  199. linked, ensuring that it's available when this test runs.
  200. config PM_SLEEP_DEBUG
  201. def_bool y
  202. depends on PM_DEBUG && PM_SLEEP
  203. config DPM_WATCHDOG
  204. bool "Device suspend/resume watchdog"
  205. depends on PM_DEBUG && PSTORE && EXPERT
  206. help
  207. Sets up a watchdog timer to capture drivers that are
  208. locked up attempting to suspend/resume a device.
  209. A detected lockup causes system panic with message
  210. captured in pstore device for inspection in subsequent
  211. boot session.
  212. config DPM_WATCHDOG_TIMEOUT
  213. int "Watchdog timeout in seconds"
  214. range 1 120
  215. default 120
  216. depends on DPM_WATCHDOG
  217. config PM_TRACE
  218. bool
  219. help
  220. This enables code to save the last PM event point across
  221. reboot. The architecture needs to support this, x86 for
  222. example does by saving things in the RTC, see below.
  223. The architecture specific code must provide the extern
  224. functions from <linux/resume-trace.h> as well as the
  225. <asm/resume-trace.h> header with a TRACE_RESUME() macro.
  226. The way the information is presented is architecture-
  227. dependent, x86 will print the information during a
  228. late_initcall.
  229. config PM_TRACE_RTC
  230. bool "Suspend/resume event tracing"
  231. depends on PM_SLEEP_DEBUG
  232. depends on X86
  233. select PM_TRACE
  234. help
  235. This enables some cheesy code to save the last PM event point in the
  236. RTC across reboots, so that you can debug a machine that just hangs
  237. during suspend (or more commonly, during resume).
  238. To use this debugging feature you should attempt to suspend the
  239. machine, reboot it and then run
  240. dmesg -s 1000000 | grep 'hash matches'
  241. CAUTION: this option will cause your machine's real-time clock to be
  242. set to an invalid time after a resume.
  243. config APM_EMULATION
  244. tristate "Advanced Power Management Emulation"
  245. depends on SYS_SUPPORTS_APM_EMULATION
  246. help
  247. APM is a BIOS specification for saving power using several different
  248. techniques. This is mostly useful for battery powered laptops with
  249. APM compliant BIOSes. If you say Y here, the system time will be
  250. reset after a RESUME operation, the /proc/apm device will provide
  251. battery status information, and user-space programs will receive
  252. notification of APM "events" (e.g. battery status change).
  253. In order to use APM, you will need supporting software. For location
  254. and more information, read <file:Documentation/power/apm-acpi.rst>
  255. and the Battery Powered Linux mini-HOWTO, available from
  256. <http://www.tldp.org/docs.html#howto>.
  257. This driver does not spin down disk drives (see the hdparm(8)
  258. manpage ("man 8 hdparm") for that), and it doesn't turn off
  259. VESA-compliant "green" monitors.
  260. Generally, if you don't have a battery in your machine, there isn't
  261. much point in using this driver and you should say N. If you get
  262. random kernel OOPSes or reboots that don't seem to be related to
  263. anything, try disabling/enabling this option (or disabling/enabling
  264. APM in your BIOS).
  265. config PM_CLK
  266. def_bool y
  267. depends on PM && HAVE_CLK
  268. config PM_GENERIC_DOMAINS
  269. bool
  270. depends on PM
  271. config WQ_POWER_EFFICIENT_DEFAULT
  272. bool "Enable workqueue power-efficient mode by default"
  273. depends on PM
  274. help
  275. Per-cpu workqueues are generally preferred because they show
  276. better performance thanks to cache locality; unfortunately,
  277. per-cpu workqueues tend to be more power hungry than unbound
  278. workqueues.
  279. Enabling workqueue.power_efficient kernel parameter makes the
  280. per-cpu workqueues which were observed to contribute
  281. significantly to power consumption unbound, leading to measurably
  282. lower power usage at the cost of small performance overhead.
  283. This config option determines whether workqueue.power_efficient
  284. is enabled by default.
  285. If in doubt, say N.
  286. config PM_GENERIC_DOMAINS_SLEEP
  287. def_bool y
  288. depends on PM_SLEEP && PM_GENERIC_DOMAINS
  289. config PM_GENERIC_DOMAINS_OF
  290. def_bool y
  291. depends on PM_GENERIC_DOMAINS && OF
  292. config CPU_PM
  293. bool
  294. config ENERGY_MODEL
  295. bool "Energy Model for devices with DVFS (CPUs, GPUs, etc)"
  296. depends on SMP
  297. depends on CPU_FREQ
  298. help
  299. Several subsystems (thermal and/or the task scheduler for example)
  300. can leverage information about the energy consumed by devices to
  301. make smarter decisions. This config option enables the framework
  302. from which subsystems can access the energy models.
  303. The exact usage of the energy model is subsystem-dependent.
  304. If in doubt, say N.