]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86/intel-uncore-freq: Handle autonomous UFS status bit
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 25 Mar 2026 19:29:09 +0000 (12:29 -0700)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 27 Mar 2026 11:14:44 +0000 (13:14 +0200)
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: 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://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>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c

index 1237d9570886507673ecf6b8e4ce0438f1284c12..4c7e64db478c02a51990623e9ced83a8cef6af67 100644 (file)
@@ -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);