Skip to content

Commit 4ab604b

Browse files
spandruvadaij-intel
authored andcommitted
platform/x86/intel-uncore-freq: Handle autonomous UFS status bit
When the AUTONOMOUS_UFS_DISABLED bit is set in the header, the ELC (Efficiency Latency Control) feature is non-functional. Hence, return error for read or write to ELC attributes. 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://patch.msgid.link/20260325192909.3417322-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 e1415b9 commit 4ab604b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ static void set_cdie_id(int domain_id, struct tpmi_uncore_cluster_info *cluster_
537537
#define UNCORE_VERSION_MASK GENMASK_ULL(7, 0)
538538
#define UNCORE_LOCAL_FABRIC_CLUSTER_ID_MASK GENMASK_ULL(15, 8)
539539
#define UNCORE_CLUSTER_OFF_MASK GENMASK_ULL(7, 0)
540+
#define UNCORE_AUTONOMOUS_UFS_DISABLED BIT(32)
540541
#define UNCORE_MAX_CLUSTER_PER_DOMAIN 8
541542

542543
static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id)
@@ -598,6 +599,7 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_
598599

599600
for (i = 0; i < num_resources; ++i) {
600601
struct tpmi_uncore_power_domain_info *pd_info;
602+
bool auto_ufs_enabled;
601603
struct resource *res;
602604
u64 cluster_offset;
603605
u8 cluster_mask;
@@ -647,6 +649,8 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_
647649
continue;
648650
}
649651

652+
auto_ufs_enabled = !(header & UNCORE_AUTONOMOUS_UFS_DISABLED);
653+
650654
/* Find out number of clusters in this resource */
651655
pd_info->cluster_count = hweight8(cluster_mask);
652656

@@ -689,7 +693,9 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_
689693

690694
cluster_info->uncore_root = tpmi_uncore;
691695

692-
if (TPMI_MINOR_VERSION(pd_info->ufs_header_ver) >= UNCORE_ELC_SUPPORTED_VERSION)
696+
if ((TPMI_MINOR_VERSION(pd_info->ufs_header_ver) >=
697+
UNCORE_ELC_SUPPORTED_VERSION) &&
698+
auto_ufs_enabled)
693699
cluster_info->elc_supported = true;
694700

695701
ret = uncore_freq_add_entry(&cluster_info->uncore_data, 0);

0 commit comments

Comments
 (0)