Skip to contentSkip to conversation

platform/x86/intel-uncore-freq: Use the same IO domain IDs as ISST

PATCH New Srinivas Pandruvada 1 participant 1 message Nov 15

Subsystems (2)
lore
Share & tools
lore

Srinivas Pandruvada

author maintainer
#0 lore raw

PATCH 1/1 platform/x86/intel-uncore-freq: Use the same IO domain IDs as ISST

The uncore frequency driver and the Intel Speed Select (ISST) driver both present power domain IDs, which are unique in a package. Compute die domain IDs are the same in both drivers, as they come from the hardware provided cdie_mask.

The Intel Speed Select user space tool shows the uncore frequency limits of IO dies, which are set using the uncore frequency sysfs interface. To find the uncore frequency entry of an IO die, user space needs the same power domain ID from both drivers. Otherwise it needs to rely on platform specific knowledge to map IO dies between the two interfaces.

But IO domain IDs are assigned differently:

ISST: IO domain IDs start after the highest compute die ID of the last partition, which is fls() of its cdie_mask, and are assigned in partition order.

Uncore: IO domain IDs start at the maximum of topology_max_dies_per_package() and the compute die range of the partition which is probed first, and are assigned in probe order.

So on a partitioned system, the IO domain IDs of the two drivers differ:

- When partition 1 is probed before partition 0. For example with cdie_mask 0b0011 and 0b1100 and one IO die in each partition, ISST uses 4 for the IO die of partition 0 and 5 for partition 1, while uncore uses 5 and 4.

Use the same method as ISST, which doesn't depend on the probe order or the CPU topology. As a partition only knows its own cdie_mask, store the cdie_mask and the number of IO dies of each partition at probe, and resolve the IO domain ID when the domain_id attribute is read.

When the hardware doesn't provide cdie_mask, the system is not partitioned. Use the resource index as the domain ID, same as ISST.

There is no change in the domain IDs presented to user space on non-partitioned systems with cdie_mask. On partitioned systems there is no change, when partition 0 is probed first and the number of dies from the CPU topology covers all compute dies. Without cdie_mask, there is no change when the CPU doesn't enumerate dies.

Fixes a191224186ec ("platform/x86/intel-uncore-freq: Present unique domain ID per package")
---
 .../uncore-frequency-common.c                 |  14 +-
 .../uncore-frequency-common.h                 |   1 +
 .../uncore-frequency/uncore-frequency-tpmi.c  | 142 ++++++++++++------
 3 files changed, 106 insertions(+), 51 deletions(-)
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +13 -1
index 22019099a857..060414d9bbfe 100644
@@ -25,8 +25,20 @@ static int (*uncore_write)(struct uncore_data *data, unsigned int input, enum un
 static ssize_t show_domain_id(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
 {
 	struct uncore_data *data = container_of(attr, struct uncore_data, domain_id_kobj_attr);
+	unsigned int value;
+	int ret;
 
-	return sysfs_emit(buf, "%u\n", data->domain_id);
+	/*
+	 * Some domain IDs can only be resolved after all partitions are
+	 * probed. The driver uses its own lock for the domain IDs.
+	 */
+	ret = uncore_read(data, &value, UNCORE_INDEX_DOMAIN_ID);
+	if (ret == -EOPNOTSUPP)
+		value = data->domain_id;
+	else if (ret)
+		return ret;
+
+	return sysfs_emit(buf, "%u\n", value);
 }
 
 static ssize_t show_instance_id(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h +1 -0
index e319448dc1a4..c77e4d98e3ca 100644
@@ -108,6 +108,7 @@ enum uncore_index {
 	UNCORE_INDEX_EFF_LAT_CTRL_HIGH_THRESHOLD_ENABLE,
 	UNCORE_INDEX_EFF_LAT_CTRL_FREQ,
 	UNCORE_INDEX_DIE_ID,
+	UNCORE_INDEX_DOMAIN_ID,
 };
 
 int uncore_freq_common_init(int (*read)(struct uncore_data *data, unsigned int *value,
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c +92 -50

194 lines not on this page · raw message

Signature · 1 line
2.55.0