linux-yocto/drivers/powercap
Zhang Rui 3605463628 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:03:20 +02:00
..
arm_scmi_powercap.c
dtpm_cpu.c
dtpm_devfreq.c powercap: dtpm_devfreq: Fix error check against dev_pm_qos_add_request() 2024-11-01 01:58:31 +01:00
dtpm_subsys.h
dtpm.c
idle_inject.c
intel_rapl_common.c powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed 2025-07-10 16:03:20 +02:00
intel_rapl_msr.c
intel_rapl_tpmi.c powercap: intel_rapl_tpmi: Fix bogus register reading 2024-10-17 15:24:36 +02:00
Kconfig
Makefile
powercap_sys.c powercap: call put_device() on an error path in powercap_register_control_type() 2025-03-22 12:50:40 -07:00