How can I disable CONFIG_PM when building Linux kernel for x86_64

2.1k Views Asked by At

I've unselected all options in the "Power Management and ACPI options" submenu,

enter image description here But options CONFIG_PM, CONFIG_PM_SLEEP are still enabled,

# Power management and ACPI options
#
# CONFIG_SUSPEND is not set
CONFIG_HIBERNATE_CALLBACKS=y
# CONFIG_HIBERNATION is not set
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_CLK=y
CONFIG_PM_GENERIC_DOMAINS=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
CONFIG_PM_GENERIC_DOMAINS_OF=y
# CONFIG_ENERGY_MODEL is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
# CONFIG_ACPI is not set
CONFIG_X86_PM_TIMER=y

And manually editing .config to change all options to "is not set" didn't work either. After running "make", these options would be enabled automatically. How can I disable CONFIG_PM and CONFIG_PM_SLEEP?

1

There are 1 best solutions below

5
stark On

I used the following from the top level of my kernel source:

find . -name Kconfig -exec grep -H 'select PM$' {} \;

which, unless you are running on arm/mach, finds only kernel/power/Kconfig. PM will be forced on only if you turn on PM_SLEEP. Otherwise, turning off PM turns off all power management.

Edit: Note that PM_SLEEP has "def_bool y" This means that unless explicitly set, it will be turned on. To turn it off, change .config to:

CONFIG_PM_SLEEP=n

Note that this means the developers are pretty sure they want this on all the time, so the code isn't being tested with it off. You will be on your own to find and fix bugs that may result from turning it off.