Kconfig 12 KB

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