linux/drivers/powercap
Kuppuswamy Sathyanarayanan 748d6ba43a powercap: intel_rapl: Enable MSR-based RAPL PMU support
Currently, RAPL PMU support requires adding CPU model entries to
arch/x86/events/rapl.c for each new generation. However, RAPL MSRs are
not architectural and require platform-specific customization, making
arch/x86 an inappropriate location for this functionality.

The powercap subsystem already handles RAPL functionality and is the
natural place to consolidate all RAPL features. The powercap RAPL
driver already includes PMU support for TPMI-based RAPL interfaces,
making it straightforward to extend this support to MSR-based RAPL
interfaces as well.

This consolidation eliminates the need to maintain RAPL support in
multiple subsystems and provides a unified approach for both TPMI and
MSR-based RAPL implementations.

The MSR-based PMU support includes the following updates:

 1. Register MSR-based PMU support for the supported platforms
    and unregister it when no online CPUs remain in the package.

 2. Remove existing checks that restrict RAPL PMU support to TPMI-based
    interfaces and extend the logic to allow MSR-based RAPL interfaces.

 3. Define a CPU model list to determine which processors should
    register RAPL PMU interface through the powercap driver for
    MSR-based RAPL, excluding those that support TPMI interface.
    This list prevents conflicts with existing arch/x86 PMU code
    that already registers RAPL PMU for some processors. Add
    Panther Lake & Wildcat Lake to the CPU models list.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Changelog edits ]
Link: https://patch.msgid.link/20251121000539.386069-3-sathyanarayanan.kuppuswamy@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-11-21 21:47:08 +01:00
..
Kconfig PM: EM: Rework the depends on for CONFIG_ENERGY_MODEL 2025-03-07 15:23:46 +01:00
Makefile powercap: intel_rapl: Introduce RAPL TPMI interface driver 2023-05-24 18:46:20 +02:00
arm_scmi_powercap.c powercap: arm_scmi: Remove recursion while parsing zones 2023-07-20 20:27:10 +02:00
dtpm.c powercap: dtpm: Fix kernel-doc for dtpm_create_hierarchy() function 2024-03-01 21:39:10 +01:00
dtpm_cpu.c powercap: dtpm_cpu: Fix NULL pointer dereference in get_pd_power_uw() 2025-07-03 17:19:37 +02:00
dtpm_devfreq.c powercap: dtpm_devfreq: Fix error check against dev_pm_qos_add_request() 2024-10-21 13:23:06 +02:00
dtpm_subsys.h powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
idle_inject.c powercap: idle_inject: use us_to_ktime() where appropriate 2025-08-21 21:57:54 +02:00
intel_rapl_common.c powercap: intel_rapl: Enable MSR-based RAPL PMU support 2025-11-21 21:47:08 +01:00
intel_rapl_msr.c powercap: intel_rapl: Enable MSR-based RAPL PMU support 2025-11-21 21:47:08 +01:00
intel_rapl_tpmi.c powercap: intel_rapl: Prepare read_raw() interface for atomic-context callers 2025-11-21 21:47:08 +01:00
powercap_sys.c powercap: call put_device() on an error path in powercap_register_control_type() 2025-01-23 21:28:18 +01:00