| From b71bafe3c1f2d97b5e10373e8e9c4da721b77059 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Tue, 23 Dec 2025 18:09:11 +0800 |
| Subject: ACPI: processor: Update cpuidle driver check in |
| __acpi_processor_start() |
| |
| From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| |
| [ Upstream commit 0089ce1c056aee547115bdc25c223f8f88c08498 ] |
| |
| Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle |
| driver registration") moved the ACPI idle driver registration to |
| acpi_processor_driver_init() and acpi_processor_power_init() does |
| not register an idle driver any more. |
| |
| Accordingly, the cpuidle driver check in __acpi_processor_start() needs |
| to be updated to avoid calling acpi_processor_power_init() without a |
| cpuidle driver, in which case the registration of the cpuidle device |
| in that function would lead to a NULL pointer dereference in |
| __cpuidle_register_device(). |
| |
| Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration") |
| Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> |
| Tested-by: Borislav Petkov (AMD) <bp@alien8.de> |
| Link: https://patch.msgid.link/20251223100914.2407069-4-lihuisong@huawei.com |
| Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/acpi/processor_driver.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c |
| index 65e779be64ffc..7644de24d2faa 100644 |
| --- a/drivers/acpi/processor_driver.c |
| +++ b/drivers/acpi/processor_driver.c |
| @@ -166,7 +166,7 @@ static int __acpi_processor_start(struct acpi_device *device) |
| if (result && !IS_ENABLED(CONFIG_ACPI_CPU_FREQ_PSS)) |
| dev_dbg(&device->dev, "CPPC data invalid or not present\n"); |
| |
| - if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver) |
| + if (cpuidle_get_driver() == &acpi_idle_driver) |
| acpi_processor_power_init(pr); |
| |
| acpi_pss_perf_init(pr); |
| -- |
| 2.51.0 |
| |