]> git.ipfire.org Git - thirdparty/linux.git/commit
ACPI: processor: idle: Optimize ACPI idle driver registration
authorHuisong Li <lihuisong@huawei.com>
Tue, 23 Dec 2025 10:09:09 +0000 (18:09 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 9 Jan 2026 21:38:21 +0000 (22:38 +0100)
commit13ebeef6a1b9c4e5c9789f835cc4ec34873f0bb1
tree1ea9bcb3d028edfb392c33716e513007ce83ea51
parent9ace4753a5202b02191d54e9fdf7f9e3d02b85eb
ACPI: processor: idle: Optimize ACPI idle driver registration

Currently, the ACPI idle driver is registered from within a CPU
hotplug callback. Although this didn't cause any functional issues,
this is questionable and confusing. And it is better to register
the cpuidle driver when all of the CPUs have been brought up.

So add a new function to initialize acpi_idle_driver based on the
power management information of an available CPU and register cpuidle
driver in acpi_processor_driver_init().

This commit has four changes under the commit 7a8c994cbb2d (ACPI:
processor: idle: Optimize ACPI idle driver registration):

 1) move acpi_processor_register_idle_driver() ahead of the
    driver_register().
 2) add acpi_processor_cstate_first_run_checks() before calling
    acpi_processor_get_power_info().
 3) squash the commit 9d68320b2bca (ACPI: processor: idle: Fix
    function defined but not used warning) into this change.
 4) use for_each_possible_cpu(cpu) to scan all possible cpus.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
[ rjw: New comment edits, changelog tweak ]
Link: https://patch.msgid.link/20251223100914.2407069-2-lihuisong@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/processor_driver.c
drivers/acpi/processor_idle.c
include/acpi/processor.h