Unverified Commit 4ab604b3 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Ilpo Järvinen
Browse files

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: bb516dc7 ("platform/x86/intel-uncore-freq: Add support for efficiency latency control")
Signed-off-by: default avatarSrinivas 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: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent e1415b94
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -537,6 +537,7 @@ static void set_cdie_id(int domain_id, struct tpmi_uncore_cluster_info *cluster_
#define UNCORE_VERSION_MASK			GENMASK_ULL(7, 0)
#define UNCORE_LOCAL_FABRIC_CLUSTER_ID_MASK	GENMASK_ULL(15, 8)
#define UNCORE_CLUSTER_OFF_MASK			GENMASK_ULL(7, 0)
#define UNCORE_AUTONOMOUS_UFS_DISABLED		BIT(32)
#define UNCORE_MAX_CLUSTER_PER_DOMAIN		8

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_

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

		auto_ufs_enabled = !(header & UNCORE_AUTONOMOUS_UFS_DISABLED);

		/* Find out number of clusters in this resource */
		pd_info->cluster_count = hweight8(cluster_mask);

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

			cluster_info->uncore_root = tpmi_uncore;

			if (TPMI_MINOR_VERSION(pd_info->ufs_header_ver) >= UNCORE_ELC_SUPPORTED_VERSION)
			if ((TPMI_MINOR_VERSION(pd_info->ufs_header_ver) >=
			     UNCORE_ELC_SUPPORTED_VERSION) &&
			    auto_ufs_enabled)
				cluster_info->elc_supported = true;

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