Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 config SUSPEND
0003         bool "Suspend to RAM and standby"
0004         depends on ARCH_SUSPEND_POSSIBLE
0005         default y
0006         help
0007           Allow the system to enter sleep states in which main memory is
0008           powered and thus its contents are preserved, such as the
0009           suspend-to-RAM state (e.g. the ACPI S3 state).
0010 
0011 config SUSPEND_FREEZER
0012         bool "Enable freezer for suspend to RAM/standby" \
0013                 if ARCH_WANTS_FREEZER_CONTROL || BROKEN
0014         depends on SUSPEND
0015         default y
0016         help
0017           This allows you to turn off the freezer for suspend. If this is
0018           done, no tasks are frozen for suspend to RAM/standby.
0019 
0020           Turning OFF this setting is NOT recommended! If in doubt, say Y.
0021 
0022 config SUSPEND_SKIP_SYNC
0023         bool "Skip kernel's sys_sync() on suspend to RAM/standby"
0024         depends on SUSPEND
0025         depends on EXPERT
0026         help
0027           Skip the kernel sys_sync() before freezing user processes.
0028           Some systems prefer not to pay this cost on every invocation
0029           of suspend, or they are content with invoking sync() from
0030           user-space before invoking suspend.  There's a run-time switch
0031           at '/sys/power/sync_on_suspend' to configure this behaviour.
0032           This setting changes the default for the run-tim switch. Say Y
0033           to change the default to disable the kernel sys_sync().
0034 
0035 config HIBERNATE_CALLBACKS
0036         bool
0037 
0038 config HIBERNATION
0039         bool "Hibernation (aka 'suspend to disk')"
0040         depends on SWAP && ARCH_HIBERNATION_POSSIBLE
0041         select HIBERNATE_CALLBACKS
0042         select LZO_COMPRESS
0043         select LZO_DECOMPRESS
0044         select CRC32
0045         help
0046           Enable the suspend to disk (STD) functionality, which is usually
0047           called "hibernation" in user interfaces.  STD checkpoints the
0048           system and powers it off; and restores that checkpoint on reboot.
0049 
0050           You can suspend your machine with 'echo disk > /sys/power/state'
0051           after placing resume=/dev/swappartition on the kernel command line
0052           in your bootloader's configuration file.
0053 
0054           Alternatively, you can use the additional userland tools available
0055           from <http://suspend.sf.net>.
0056 
0057           In principle it does not require ACPI or APM, although for example
0058           ACPI will be used for the final steps when it is available.  One
0059           of the reasons to use software suspend is that the firmware hooks
0060           for suspend states like suspend-to-RAM (STR) often don't work very
0061           well with Linux.
0062 
0063           It creates an image which is saved in your active swap. Upon the next
0064           boot, pass the 'resume=/dev/swappartition' argument to the kernel to
0065           have it detect the saved image, restore memory state from it, and
0066           continue to run as before. If you do not want the previous state to
0067           be reloaded, then use the 'noresume' kernel command line argument.
0068           Note, however, that fsck will be run on your filesystems and you will
0069           need to run mkswap against the swap partition used for the suspend.
0070 
0071           It also works with swap files to a limited extent (for details see
0072           <file:Documentation/power/swsusp-and-swap-files.rst>).
0073 
0074           Right now you may boot without resuming and resume later but in the
0075           meantime you cannot use the swap partition(s)/file(s) involved in
0076           suspending.  Also in this case you must not use the filesystems
0077           that were mounted before the suspend.  In particular, you MUST NOT
0078           MOUNT any journaled filesystems mounted before the suspend or they
0079           will get corrupted in a nasty way.
0080 
0081           For more information take a look at <file:Documentation/power/swsusp.rst>.
0082 
0083 config HIBERNATION_SNAPSHOT_DEV
0084         bool "Userspace snapshot device"
0085         depends on HIBERNATION
0086         default y
0087         help
0088           Device used by the uswsusp tools.
0089 
0090           Say N if no snapshotting from userspace is needed, this also
0091           reduces the attack surface of the kernel.
0092 
0093           If in doubt, say Y.
0094 
0095 config PM_STD_PARTITION
0096         string "Default resume partition"
0097         depends on HIBERNATION
0098         default ""
0099         help
0100           The default resume partition is the partition that the suspend-
0101           to-disk implementation will look for a suspended disk image.
0102 
0103           The partition specified here will be different for almost every user.
0104           It should be a valid swap partition (at least for now) that is turned
0105           on before suspending.
0106 
0107           The partition specified can be overridden by specifying:
0108 
0109                 resume=/dev/<other device>
0110 
0111           which will set the resume partition to the device specified.
0112 
0113           Note there is currently not a way to specify which device to save the
0114           suspended image to. It will simply pick the first available swap
0115           device.
0116 
0117 config PM_SLEEP
0118         def_bool y
0119         depends on SUSPEND || HIBERNATE_CALLBACKS
0120         select PM
0121         select SRCU
0122 
0123 config PM_SLEEP_SMP
0124         def_bool y
0125         depends on SMP
0126         depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
0127         depends on PM_SLEEP
0128         select HOTPLUG_CPU
0129 
0130 config PM_SLEEP_SMP_NONZERO_CPU
0131         def_bool y
0132         depends on PM_SLEEP_SMP
0133         depends on ARCH_SUSPEND_NONZERO_CPU
0134         help
0135         If an arch can suspend (for suspend, hibernate, kexec, etc) on a
0136         non-zero numbered CPU, it may define ARCH_SUSPEND_NONZERO_CPU. This
0137         will allow nohz_full mask to include CPU0.
0138 
0139 config PM_AUTOSLEEP
0140         bool "Opportunistic sleep"
0141         depends on PM_SLEEP
0142         help
0143         Allow the kernel to trigger a system transition into a global sleep
0144         state automatically whenever there are no active wakeup sources.
0145 
0146 config PM_USERSPACE_AUTOSLEEP
0147         bool "Userspace opportunistic sleep"
0148         depends on PM_SLEEP
0149         help
0150         Notify kernel of aggressive userspace autosleep power management policy.
0151 
0152         This option changes the behavior of various sleep-sensitive code to deal
0153         with frequent userspace-initiated transitions into a global sleep state.
0154 
0155         Saying Y here, disables code paths that most users really should keep
0156         enabled. In particular, only enable this if it is very common to be
0157         asleep/awake for very short periods of time (<= 2 seconds).
0158 
0159         Only platforms, such as Android, that implement opportunistic sleep from
0160         a userspace power manager service should enable this option; and not
0161         other machines. Therefore, you should say N here, unless you are
0162         extremely certain that this is what you want. The option otherwise has
0163         bad, undesirable effects, and should not be enabled just for fun.
0164 
0165 
0166 config PM_WAKELOCKS
0167         bool "User space wakeup sources interface"
0168         depends on PM_SLEEP
0169         help
0170         Allow user space to create, activate and deactivate wakeup source
0171         objects with the help of a sysfs-based interface.
0172 
0173 config PM_WAKELOCKS_LIMIT
0174         int "Maximum number of user space wakeup sources (0 = no limit)"
0175         range 0 100000
0176         default 100
0177         depends on PM_WAKELOCKS
0178 
0179 config PM_WAKELOCKS_GC
0180         bool "Garbage collector for user space wakeup sources"
0181         depends on PM_WAKELOCKS
0182         default y
0183 
0184 config PM
0185         bool "Device power management core functionality"
0186         help
0187           Enable functionality allowing I/O devices to be put into energy-saving
0188           (low power) states, for example after a specified period of inactivity
0189           (autosuspended), and woken up in response to a hardware-generated
0190           wake-up event or a driver's request.
0191 
0192           Hardware support is generally required for this functionality to work
0193           and the bus type drivers of the buses the devices are on are
0194           responsible for the actual handling of device suspend requests and
0195           wake-up events.
0196 
0197 config PM_DEBUG
0198         bool "Power Management Debug Support"
0199         depends on PM
0200         help
0201         This option enables various debugging support in the Power Management
0202         code. This is helpful when debugging and reporting PM bugs, like
0203         suspend support.
0204 
0205 config PM_ADVANCED_DEBUG
0206         bool "Extra PM attributes in sysfs for low-level debugging/testing"
0207         depends on PM_DEBUG
0208         help
0209         Add extra sysfs attributes allowing one to access some Power Management
0210         fields of device objects from user space.  If you are not a kernel
0211         developer interested in debugging/testing Power Management, say "no".
0212 
0213 config PM_TEST_SUSPEND
0214         bool "Test suspend/resume and wakealarm during bootup"
0215         depends on SUSPEND && PM_DEBUG && RTC_CLASS=y
0216         help
0217         This option will let you suspend your machine during bootup, and
0218         make it wake up a few seconds later using an RTC wakeup alarm.
0219         Enable this with a kernel parameter like "test_suspend=mem".
0220 
0221         You probably want to have your system's RTC driver statically
0222         linked, ensuring that it's available when this test runs.
0223 
0224 config PM_SLEEP_DEBUG
0225         def_bool y
0226         depends on PM_DEBUG && PM_SLEEP
0227 
0228 config DPM_WATCHDOG
0229         bool "Device suspend/resume watchdog"
0230         depends on PM_DEBUG && PSTORE && EXPERT
0231         help
0232           Sets up a watchdog timer to capture drivers that are
0233           locked up attempting to suspend/resume a device.
0234           A detected lockup causes system panic with message
0235           captured in pstore device for inspection in subsequent
0236           boot session.
0237 
0238 config DPM_WATCHDOG_TIMEOUT
0239         int "Watchdog timeout in seconds"
0240         range 1 120
0241         default 120
0242         depends on DPM_WATCHDOG
0243 
0244 config PM_TRACE
0245         bool
0246         help
0247           This enables code to save the last PM event point across
0248           reboot. The architecture needs to support this, x86 for
0249           example does by saving things in the RTC, see below.
0250 
0251           The architecture specific code must provide the extern
0252           functions from <linux/resume-trace.h> as well as the
0253           <asm/resume-trace.h> header with a TRACE_RESUME() macro.
0254 
0255           The way the information is presented is architecture-
0256           dependent, x86 will print the information during a
0257           late_initcall.
0258 
0259 config PM_TRACE_RTC
0260         bool "Suspend/resume event tracing"
0261         depends on PM_SLEEP_DEBUG
0262         depends on X86
0263         select PM_TRACE
0264         help
0265         This enables some cheesy code to save the last PM event point in the
0266         RTC across reboots, so that you can debug a machine that just hangs
0267         during suspend (or more commonly, during resume).
0268 
0269         To use this debugging feature you should attempt to suspend the
0270         machine, reboot it and then run
0271 
0272                 dmesg -s 1000000 | grep 'hash matches'
0273 
0274         CAUTION: this option will cause your machine's real-time clock to be
0275         set to an invalid time after a resume.
0276 
0277 config APM_EMULATION
0278         tristate "Advanced Power Management Emulation"
0279         depends on SYS_SUPPORTS_APM_EMULATION
0280         help
0281           APM is a BIOS specification for saving power using several different
0282           techniques. This is mostly useful for battery powered laptops with
0283           APM compliant BIOSes. If you say Y here, the system time will be
0284           reset after a RESUME operation, the /proc/apm device will provide
0285           battery status information, and user-space programs will receive
0286           notification of APM "events" (e.g. battery status change).
0287 
0288           In order to use APM, you will need supporting software. For location
0289           and more information, read <file:Documentation/power/apm-acpi.rst>
0290           and the Battery Powered Linux mini-HOWTO, available from
0291           <http://www.tldp.org/docs.html#howto>.
0292 
0293           This driver does not spin down disk drives (see the hdparm(8)
0294           manpage ("man 8 hdparm") for that), and it doesn't turn off
0295           VESA-compliant "green" monitors.
0296 
0297           Generally, if you don't have a battery in your machine, there isn't
0298           much point in using this driver and you should say N. If you get
0299           random kernel OOPSes or reboots that don't seem to be related to
0300           anything, try disabling/enabling this option (or disabling/enabling
0301           APM in your BIOS).
0302 
0303 config PM_CLK
0304         def_bool y
0305         depends on PM && HAVE_CLK
0306 
0307 config PM_GENERIC_DOMAINS
0308         bool
0309         depends on PM
0310 
0311 config WQ_POWER_EFFICIENT_DEFAULT
0312         bool "Enable workqueue power-efficient mode by default"
0313         depends on PM
0314         help
0315           Per-cpu workqueues are generally preferred because they show
0316           better performance thanks to cache locality; unfortunately,
0317           per-cpu workqueues tend to be more power hungry than unbound
0318           workqueues.
0319 
0320           Enabling workqueue.power_efficient kernel parameter makes the
0321           per-cpu workqueues which were observed to contribute
0322           significantly to power consumption unbound, leading to measurably
0323           lower power usage at the cost of small performance overhead.
0324 
0325           This config option determines whether workqueue.power_efficient
0326           is enabled by default.
0327 
0328           If in doubt, say N.
0329 
0330 config PM_GENERIC_DOMAINS_SLEEP
0331         def_bool y
0332         depends on PM_SLEEP && PM_GENERIC_DOMAINS
0333 
0334 config PM_GENERIC_DOMAINS_OF
0335         def_bool y
0336         depends on PM_GENERIC_DOMAINS && OF
0337 
0338 config CPU_PM
0339         bool
0340 
0341 config ENERGY_MODEL
0342         bool "Energy Model for devices with DVFS (CPUs, GPUs, etc)"
0343         depends on SMP
0344         depends on CPU_FREQ
0345         help
0346           Several subsystems (thermal and/or the task scheduler for example)
0347           can leverage information about the energy consumed by devices to
0348           make smarter decisions. This config option enables the framework
0349           from which subsystems can access the energy models.
0350 
0351           The exact usage of the energy model is subsystem-dependent.
0352 
0353           If in doubt, say N.