]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: processor: idle: Reset cpuidle on C-state list changes
authorHuisong Li <lihuisong@huawei.com>
Tue, 7 Apr 2026 08:11:41 +0000 (16:11 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Apr 2026 13:32:20 +0000 (15:32 +0200)
commit07cba0de5598a427cc8a7161202ebf4e79e692bd
tree07b32c4ef82c704006bf8a96d4230acdc58501ba
parenta4c6c18e93a1d24df9ab95794cef471c89daefe4
ACPI: processor: idle: Reset cpuidle on C-state list changes

When a power notification event occurs, existing ACPI idle states may
become obsolete. The current implementation only performs a partial
update, leaving critical cpuidle parameters, like target_residency_ns
and exit_latency_ns, stale. Furthermore, per-CPU cpuidle_device data,
including last_residency_ns, states_usage, and the disable flag, are not
properly synchronized. Using these stale values leads to incorrect power
management decisions.

To ensure all parameters are correctly synchronized, modify the
notification handling logic:

 1. Unregister all cpuidle_device instances to ensure a clean slate.
 2. Unregister and re-register the ACPI idle driver. This forces the
    framework to re-evaluate global state parameters and ensures the
    driver state matches the new hardware power profile.
 3. Re-initialize power information and re-register cpuidle_device for
    all possible CPUs to restore functional idle management.

This complete reset ensures that the cpuidle framework and the underlying
ACPI states are perfectly synchronized after a power state change.

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