[PATCH v5 00/11] Enhanced autonomous selection and improvements

Sumit Gupta
2025-12-23T12:13:35Z

This patch series enhances the ACPI CPPC CPUFREQ driver with
comprehensive support for autonomous performance selection, expanded
runtime control interfaces and improvements.

CPPC autonomous mode (auto_sel) enables hardware-driven CPU performance
scaling using Energy Performance Preference (EPP) hints, without OS
governor intervention. Currently, there's limited runtime control and
visibility into CPPC performance registers when using autonomous mode.

This series addresses these gaps by:
1. Exposing min_perf/max_perf registers via sysfs (as frequency in kHz)
to allow fine-grained performance bounds control in autonomous mode.
2. Exposing perf_limited register to detect and clear throttling events.
3. Keeping policy limits synchronized with hardware registers to ensure
consistent behavior between HW state and userspace view.
4. Providing boot parameter for system-wide autonomous mode enablement.

It also includes code improvements: generic sysfs helpers, struct
cleanup, new APIs for reading performance controls, and extended
epp_perf support.

The patches are grouped as below:
- Patch 1: Generic sysfs helpers. Refactoring, independent.
- Patch 2, 3 & 4: Improvements. Can be applied independently.
- Patch 5: ACPI APIs and sysfs for min/max_perf. Independent.
- Patch 6: ACPI APIs and sysfs for perf_limited. Independent.
- Patch 7: Add ABI documentation. Depends on Patch 5 and 6.
- Patch 8: Sync policy when min/max_perf updated. Depends on Patch 5.
- Patch 9: Sync policy when toggling auto_select. Depends on Patch 8.
- Patch 10: Make scaling_min/max_freq read-only. Depends on Patch 9.
- Patch 11: Boot parameter support. Depends on Patch 9.

Patches 1-7 can be applied first if they are Ok.

---
v4[4] -> v5:
- patch2: new patch to clean up cppc_perf_caps and cppc_perf_ctrls.
- patch3: moved cppc_get_perf() call from v4's patch8 to here.
- patch5: fix ABI documentation format (kernel test robot report).
- patch6: update perf_limited logic to only allow clearing set bits.
- patch8: new patch to sync policy limits when updating min/max_perf,
update_policy parameter moved from v4's patch5.
- patch9: refactored from v4's patch7, added update_reg parameter,
handle -EOPNOTSUPP for auto_sel (platforms with fixed auto_sel).
- patch10: new to make scaling_min/max_freq read-only in auto_sel mode.
- patch11 (v4's patch8): moved boot param handling to cpu_init,
handle -EOPNOTSUPP for EPP (platforms without EPP support).
- general code improvements, kernel-doc updates, reduced redundancies.

[4] has detailed changelog of previous versions.

Sumit Gupta (11):
cpufreq: CPPC: Add generic helpers for sysfs show/store
ACPI: CPPC: Clean up cppc_perf_caps and cppc_perf_ctrls structs
ACPI: CPPC: Add cppc_get_perf() API to read performance controls
ACPI: CPPC: Extend cppc_set_epp_perf() to support auto_sel and epp
ACPI: CPPC: add APIs and sysfs interface for min/max_perf
ACPI: CPPC: add APIs and sysfs interface for perf_limited
cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
cpufreq: CPPC: sync policy limits when updating min/max_perf
cpufreq: CPPC: sync policy limits when toggling auto_select
cpufreq: CPPC: make scaling_min/max_freq read-only when auto_sel
enabled
cpufreq: CPPC: add autonomous mode boot parameter support

.../ABI/testing/sysfs-devices-system-cpu | 42 ++
.../admin-guide/kernel-parameters.txt | 13 +
drivers/acpi/cppc_acpi.c | 214 ++++++++-
drivers/cpufreq/cppc_cpufreq.c | 434 ++++++++++++++++--
include/acpi/cppc_acpi.h | 46 +-
5 files changed, 712 insertions(+), 37 deletions(-)

[1] https://lore.kernel.org/lkml/20250211103737.447704-1-sumitg@nvidia.com/
[2] https://lore.kernel.org/lkml/20250823200121.1320197-1-sumitg@nvidia.com/
[3] https://lore.kernel.org/lkml/20251001150104.1275188-1-sumitg@nvidia.com/
[4] https://lore.kernel.org/lkml/20251105113844.4086250-1-sumitg@nvidia.com/

--
2.34.1