linux-yocto/drivers/powercap
Zhang Rui d8ca2036f3 powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed
commit 964209202e upstream.

PL1 cannot be disabled on some platforms. The ENABLE bit is still set
after software clears it. This behavior leads to a scenario where, upon
user request to disable the Power Limit through the powercap sysfs, the
ENABLE bit remains set while the CLAMPING bit is inadvertently cleared.

According to the Intel Software Developer's Manual, the CLAMPING bit,
"When set, allows the processor to go below the OS requested P states in
order to maintain the power below specified Platform Power Limit value."

Thus this means the system may operate at higher power levels than
intended on such platforms.

Enhance the code to check ENABLE bit after writing to it, and stop
further processing if ENABLE bit cannot be changed.

Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Fixes: 2d281d8196 ("PowerCap: Introduce Intel RAPL power capping driver")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://patch.msgid.link/20250619071340.384782-1-rui.zhang@intel.com
[ rjw: Use str_enabled_disabled() instead of open-coded equivalent ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-10 16:05:12 +02:00
..
arm_scmi_powercap.c powercap: arm_scmi: Remove recursion while parsing zones 2023-07-20 20:27:10 +02:00
dtpm_cpu.c powercap: DTPM: Avoid explicit cpumask allocation on stack 2024-04-16 13:33:03 +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
dtpm.c powercap: dtpm: Fix kernel-doc for dtpm_create_hierarchy() function 2024-03-01 21:39:10 +01:00
idle_inject.c powercap: idle_inject: Simplify if condition 2024-06-07 20:57:20 +02:00
intel_rapl_common.c powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed 2025-07-10 16:05:12 +02:00
intel_rapl_msr.c powercap: intel_rapl_msr: Add PL4 support for ArrowLake-H 2024-10-16 22:34:03 +02:00
intel_rapl_tpmi.c powercap: intel_rapl_tpmi: Ignore minor version change 2024-10-08 21:38:49 +02:00
Kconfig powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-06-12 19:48:40 +02:00
Makefile powercap: intel_rapl: Introduce RAPL TPMI interface driver 2023-05-24 18:46:20 +02:00
powercap_sys.c powercap: call put_device() on an error path in powercap_register_control_type() 2025-03-22 12:54:14 -07:00