Re: [PATCH v1 0/6] ACPI: processor: Recovery some reverted patches

From: lihuisong (C)

Date: Wed Jan 07 2026 - 05:21:39 EST


Hi Amandeep,

Could you help test this series on your platform?
It would be perfect if has your Tested-by.

/Huisong

在 2025/12/23 18:09, Huisong Li 写道:
This series of patches have been reverted due to the crash issue reported
by Borislav [1] and a missing cpuidle sysfs directory reported by Amandeep.

The root cause was commit 7a8c994cbb2d (ACPI: processor: idle: Optimize
ACPI idle driver registration). Since the other patches in the series
depended on this commit, they were also reverted.

I have analyzed these issues and implemented the following fixes:
Fix for the Crash:
The crash occurred because 'max_cstate' (which defaults to 8) was not
updated before the ACPI idle states were initialized. As a result, the idle
driver believed multiple C-states were available, but only the state with
index 1 was actually initialized in the per-CPU acpi_cstate array. When the
cpuidle governor tried to access a C-state index greater than 1, it hit a
NULL pointer.
Patch 1/6 fixes this by adding acpi_processor_cstate_first_run_checks() to
update 'max_cstate' before initialization.

Fix for missing /sys/devices/system/cpu/cpu*/cpuidle directory:
The previous optimization depended on an external patch [2]. In kernel versions
without that patch, acpi_processor_start() was being called before the ACPI idle
driver had finished registering. This caused the cpuidle device registration
to fail, resulting in the missing directory.
Patch 1/6 fixes this by moving acpi_processor_register_idle_driver() ahead of
the acpi_processor_driver registration.

Note:
In this series, only patch 1/6 has been modified to address these bugs, more
detail changes please see the commit. Patches 2-6/6 remain identical to the
versions that were previously merged.

[1] https://lore.kernel.org/lkml/20251124200019.GIaSS5U9HhsWBotrQZ@fat_crate.local/
[2] https://lore.kernel.org/all/20240529133446.28446-2-Jonathan.Cameron@xxxxxxxxxx/

Huisong Li (4):
ACPI: processor: idle: Optimize ACPI idle driver registration
ACPI: processor: Remove unused empty stubs of some functions
ACPI: processor: idle: Rearrange declarations in header file
ACPI: processor: Do not expose global variable acpi_idle_driver

Rafael J. Wysocki (2):
ACPI: processor: Update cpuidle driver check in
__acpi_processor_start()
ACPI: processor: idle: Redefine two functions as void

drivers/acpi/processor_driver.c | 13 +++-
drivers/acpi/processor_idle.c | 116 +++++++++++++++++++-------------
include/acpi/processor.h | 34 ++--------
3 files changed, 86 insertions(+), 77 deletions(-)