From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
The "instance" word has a specific meaning in the TPMI uncore frequency
scaling ecosystem. One TPMI device can have multiple copies of a feature
and each copy is called an instance.
The currently used "instance_id" uncore_data struct field is a
sequentially generated value that's used for appending to uncore
directories inside the /sys/devices/system/cpu/intel_uncore_frequency
directory. It has no relation to the TPMI device feature copy.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
---
.../x86/intel/uncore-frequency/uncore-frequency-common.c | 6 +++---
.../x86/intel/uncore-frequency/uncore-frequency-common.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
index 7070c94324e0..71c47aa77d3c 100644
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
@@ -268,7 +268,7 @@ int uncore_freq_add_entry(struct uncore_data *data, int cpu)
if (ret < 0)
goto uncore_unlock;
- data->instance_id = ret;
+ data->seqname_id = ret;
scnprintf(data->name, sizeof(data->name), "uncore%02d", ret);
} else {
scnprintf(data->name, sizeof(data->name), "package_%02d_die_%02d",
@@ -281,7 +281,7 @@ int uncore_freq_add_entry(struct uncore_data *data, int cpu)
ret = create_attr_group(data, data->name);
if (ret) {
if (data->domain_id != UNCORE_DOMAIN_ID_INVALID)
- ida_free(&intel_uncore_ida, data->instance_id);
+ ida_free(&intel_uncore_ida, data->seqname_id);
} else {
data->control_cpu = cpu;
data->valid = true;
@@ -301,7 +301,7 @@ void uncore_freq_remove_die_entry(struct uncore_data *data)
data->control_cpu = -1;
data->valid = false;
if (data->domain_id != UNCORE_DOMAIN_ID_INVALID)
- ida_free(&intel_uncore_ida, data->instance_id);
+ ida_free(&intel_uncore_ida, data->seqname_id);
mutex_unlock(&uncore_lock);
}
diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h
index 0abe850ef54e..915506de4ebf 100644
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h
@@ -35,7 +35,7 @@
* @die_id: Die id for this instance
* @domain_id: Power domain id for this instance
* @cluster_id: cluster id in a domain
- * @instance_id: Unique instance id to append to directory name
+ * @seqname_id: Unique id to append to directory name
* @name: Sysfs entry name for this instance
* @agent_type_mask: Bit mask of all hardware agents for this domain
* @uncore_attr_group: Attribute group storage
@@ -71,7 +71,7 @@ struct uncore_data {
int die_id;
int domain_id;
int cluster_id;
- int instance_id;
+ int seqname_id;
char name[32];
u16 agent_type_mask;
--
2.53.0
On Fri, 2026-03-27 at 15:36 +0000, Maciej Wieczor-Retman wrote:
> * @die_id: Die id for this instance
> * @domain_id: Power domain id for this instance
> * @cluster_id: cluster id in a domain
> - * @instance_id: Unique instance id to append to directory name
> + * @seqname_id: Unique id to append to directory name
> * @name: Sysfs entry name for this instance
> * @agent_type_mask: Bit mask of all hardware agents for this domain
> * @uncore_attr_group: Attribute group storage
> @@ -71,7 +71,7 @@ struct uncore_data {
> int die_id;
> int domain_id;
> int cluster_id;
> - int instance_id;
> + int seqname_id;
> char name[32];
> u16 agent_type_mask;
Nitpick: "seqname_id" reads like "sequence name ID" rather than a
sequence number. Consider "seqnum" or "sequence_id" for better clarity.
Just a suggestion based on how the name comes across, but not big deal.
Artem.
On 2026-03-27 at 19:56:58 +0200, Artem Bityutskiy wrote:
>On Fri, 2026-03-27 at 15:36 +0000, Maciej Wieczor-Retman wrote:
>> * @die_id: Die id for this instance
>> * @domain_id: Power domain id for this instance
>> * @cluster_id: cluster id in a domain
>> - * @instance_id: Unique instance id to append to directory name
>> + * @seqname_id: Unique id to append to directory name
>> * @name: Sysfs entry name for this instance
>> * @agent_type_mask: Bit mask of all hardware agents for this domain
>> * @uncore_attr_group: Attribute group storage
>> @@ -71,7 +71,7 @@ struct uncore_data {
>> int die_id;
>> int domain_id;
>> int cluster_id;
>> - int instance_id;
>> + int seqname_id;
>> char name[32];
>> u16 agent_type_mask;
>
>Nitpick: "seqname_id" reads like "sequence name ID" rather than a
>sequence number. Consider "seqnum" or "sequence_id" for better clarity.
>Just a suggestion based on how the name comes across, but not big deal.
>
>Artem.
sequence_id sounds good, I'll go for that. What I was going for was "seq" as in
sequential and "name" as in directory name, but looking at it again it does
seem a bit confusing.
--
Kind regards
Maciej Wieczór-Retman
© 2016 - 2026 Red Hat, Inc.