]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: processor: idle: Move max_cstate update out of the loop
authorHuisong Li <lihuisong@huawei.com>
Wed, 11 Mar 2026 06:50:37 +0000 (14:50 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 Mar 2026 18:26:13 +0000 (19:26 +0100)
The acpi_processor_cstate_first_run_checks() function, which updates
max_cstate on certain platforms, only needs to be executed once.

Move this call outside of the loop to avoid redundant executions.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://patch.msgid.link/20260311065038.4151558-3-lihuisong@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/processor_idle.c

index 758dbe79cdaf40d8a9bc0a9555d1d28ed482bb84..625f80fe0b980c5389fee14c8033d04d2379260f 100644 (file)
@@ -1359,6 +1359,8 @@ void acpi_processor_register_idle_driver(void)
        int ret = -ENODEV;
        int cpu;
 
+       acpi_processor_cstate_first_run_checks();
+
        /*
         * ACPI idle driver is used by all possible CPUs.
         * Use the processor power info of one in them to set up idle states.
@@ -1370,7 +1372,6 @@ void acpi_processor_register_idle_driver(void)
                if (!pr)
                        continue;
 
-               acpi_processor_cstate_first_run_checks();
                ret = acpi_processor_get_power_info(pr);
                if (!ret) {
                        pr->flags.power_setup_done = 1;