Skip to content

Commit dff6f36

Browse files
spandruvadaij-intel
authored andcommitted
platform/x86/intel-uncore-freq: Check write blocked for ELC
Add the missing write_blocked check for updating sysfs related to uncore efficiency latency control (ELC). If write operation is blocked return error. Fixes: bb516dc ("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>
1 parent 5b9e075 commit dff6f36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,14 @@ static int uncore_read_control_freq(struct uncore_data *data, unsigned int *valu
192192
static int write_eff_lat_ctrl(struct uncore_data *data, unsigned int val, enum uncore_index index)
193193
{
194194
struct tpmi_uncore_cluster_info *cluster_info;
195+
struct tpmi_uncore_struct *uncore_root;
195196
u64 control;
196197

197198
cluster_info = container_of(data, struct tpmi_uncore_cluster_info, uncore_data);
199+
uncore_root = cluster_info->uncore_root;
200+
201+
if (uncore_root->write_blocked)
202+
return -EPERM;
198203

199204
if (cluster_info->root_domain)
200205
return -ENODATA;

0 commit comments

Comments
 (0)