]> git.hungrycats.org Git - linux/commitdiff
ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver()
authorTony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Mon, 8 Jun 2026 19:03:59 +0000 (03:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:19 +0000 (13:36 +0200)
[ Upstream commit 66c62e6773c54ce5233eb21c6d48999c3747bd13 ]

Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle
driver registration") moved the ACPI idle driver registration to
acpi_processor_driver_init(), but it didn't check whether a cpuidle
driver was already registered.

For example, on Intel platforms, if the intel_idle driver is already
loaded, the code would still evaluate the _CST object in the ACPI
table and attempt to register the acpi_idle driver. This registration
would fail with -EBUSY due to the existing check in cpuidle_register_driver.

Add a check at the beginning of acpi_processor_register_idle_driver()
to avoid unnecessary _CST evaluate and potential registration failures.

Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration")
Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Link: https://patch.msgid.link/20260608190359.3254-1-TonyWWang-oc@zhaoxin.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/processor_idle.c

index ce07505a8de69d88d4351399ae5ae8c9a8e081cf..5c6f736ba3b528cb5076c0530c34c48300a80b17 100644 (file)
@@ -1371,6 +1371,15 @@ void acpi_processor_register_idle_driver(void)
        int ret = -ENODEV;
        int cpu;
 
+       /*
+        * If a cpuidle driver is already registered, there is no need to
+        * evaluate _CST or attempt to register the ACPI idle driver.
+        */
+       if (cpuidle_get_driver()) {
+               pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());
+               return;
+       }
+
        acpi_processor_update_max_cstate();
 
        /*