Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: Decouple ACPI idle and ACPI processor drivers

This patch introduces a new Kconfig symbol, ACPI_PROCESSOR_IDLE,
which is auto selected by architectures which support the ACPI
based C states for CPU Idle management.

The processor_idle driver in its present form contains declarations
specific to X86 and IA64. Since there are no reasonable defaults
for other architectures e.g. ARM64, the driver is selected only for
X86 or IA64.

This helps in decoupling the ACPI processor_driver from the ACPI
processor_idle driver which is useful for the upcoming alternative
patchwork for controlling CPU Performance (CPPC) and CPU Idle (LPI).

Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Ashwin Chaugule and committed by
Rafael J. Wysocki
5f05586c 239708a3

+31 -4
+5 -1
drivers/acpi/Kconfig
··· 193 193 bool 194 194 select THERMAL 195 195 196 + config ACPI_PROCESSOR_IDLE 197 + bool 198 + select CPU_IDLE 199 + 196 200 config ACPI_PROCESSOR 197 201 tristate "Processor" 198 202 depends on X86 || IA64 199 - select CPU_IDLE 203 + select ACPI_PROCESSOR_IDLE 200 204 select ACPI_CPU_FREQ_PSS 201 205 default y 202 206 help
+2 -1
drivers/acpi/Makefile
··· 80 80 obj-$(CONFIG_ACPI_BGRT) += bgrt.o 81 81 82 82 # processor has its own "processor." module_param namespace 83 - processor-y := processor_driver.o processor_idle.o 83 + processor-y := processor_driver.o 84 + processor-$(CONFIG_ACPI_PROCESSOR_IDLE) += processor_idle.o 84 85 processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o \ 85 86 processor_thermal.o 86 87 processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
+24 -2
include/acpi/processor.h
··· 355 355 #endif /* CONFIG_ACPI_CPU_FREQ_PSS */ 356 356 357 357 /* in processor_idle.c */ 358 + extern struct cpuidle_driver acpi_idle_driver; 359 + #ifdef CONFIG_ACPI_PROCESSOR_IDLE 358 360 int acpi_processor_power_init(struct acpi_processor *pr); 359 361 int acpi_processor_power_exit(struct acpi_processor *pr); 360 362 int acpi_processor_cst_has_changed(struct acpi_processor *pr); 361 363 int acpi_processor_hotplug(struct acpi_processor *pr); 362 - extern struct cpuidle_driver acpi_idle_driver; 364 + #else 365 + static inline int acpi_processor_power_init(struct acpi_processor *pr) 366 + { 367 + return -ENODEV; 368 + } 363 369 364 - #ifdef CONFIG_PM_SLEEP 370 + static inline int acpi_processor_power_exit(struct acpi_processor *pr) 371 + { 372 + return -ENODEV; 373 + } 374 + 375 + static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr) 376 + { 377 + return -ENODEV; 378 + } 379 + 380 + static inline int acpi_processor_hotplug(struct acpi_processor *pr) 381 + { 382 + return -ENODEV; 383 + } 384 + #endif /* CONFIG_ACPI_PROCESSOR_IDLE */ 385 + 386 + #if defined(CONFIG_PM_SLEEP) & defined(CONFIG_ACPI_PROCESSOR_IDLE) 365 387 void acpi_processor_syscore_init(void); 366 388 void acpi_processor_syscore_exit(void); 367 389 #else