40 lines
1.6 KiB
Diff
40 lines
1.6 KiB
Diff
From f64fb7c5338fde361fdaef01b98697a52ee8467b Mon Sep 17 00:00:00 2001
|
|
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
|
Date: Sun, 27 Jul 2025 14:05:13 -0700
|
|
Subject: platform/x86/intel-uncore-freq: Check write blocked for ELC
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Add the missing write_blocked check for updating sysfs related to uncore
|
|
efficiency latency control (ELC). If write operation is blocked return
|
|
error.
|
|
|
|
Fixes: bb516dc79c4a ("platform/x86/intel-uncore-freq: Add support for efficiency latency control")
|
|
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
|
Cc: stable@vger.kernel.org
|
|
Link: https://lore.kernel.org/r/20250727210513.2898630-1-srinivas.pandruvada@linux.intel.com
|
|
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
|
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
|
---
|
|
.../x86/intel/uncore-frequency/uncore-frequency-tpmi.c | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c
|
|
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c
|
|
@@ -191,9 +191,14 @@ static int uncore_read_control_freq(stru
|
|
static int write_eff_lat_ctrl(struct uncore_data *data, unsigned int val, enum uncore_index index)
|
|
{
|
|
struct tpmi_uncore_cluster_info *cluster_info;
|
|
+ struct tpmi_uncore_struct *uncore_root;
|
|
u64 control;
|
|
|
|
cluster_info = container_of(data, struct tpmi_uncore_cluster_info, uncore_data);
|
|
+ uncore_root = cluster_info->uncore_root;
|
|
+
|
|
+ if (uncore_root->write_blocked)
|
|
+ return -EPERM;
|
|
|
|
if (cluster_info->root_domain)
|
|
return -ENODATA;
|