Skip to content

Commit 7410fc7

Browse files
spandruvadagregkh
authored andcommitted
platform/x86/intel-uncore-freq: Check write blocked for ELC
commit dff6f36 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bf83ae3 commit 7410fc7

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
@@ -191,9 +191,14 @@ static int uncore_read_control_freq(struct uncore_data *data, unsigned int *valu
191191
static int write_eff_lat_ctrl(struct uncore_data *data, unsigned int val, enum uncore_index index)
192192
{
193193
struct tpmi_uncore_cluster_info *cluster_info;
194+
struct tpmi_uncore_struct *uncore_root;
194195
u64 control;
195196

196197
cluster_info = container_of(data, struct tpmi_uncore_cluster_info, uncore_data);
198+
uncore_root = cluster_info->uncore_root;
199+
200+
if (uncore_root->write_blocked)
201+
return -EPERM;
197202

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

0 commit comments

Comments
 (0)