From: Srinivas Pandruvada srinivas.pandruvada@linux.intel.com
[ Upstream commit 6d47b4f08436cb682fb2644e6265a3897fd42a77 ]
A partitioned system configured with only one package and one compute die, warning will be generated for duplicate sysfs entry. This typically occurs during the platform bring-up phase.
Partitioned systems expose dies, equivalent to TPMI compute domains, through the CPUID. Each partitioned system must contains at least one compute die per partition, resulting in a minimum of two dies per package. Hence the function topology_max_dies_per_package() returns at least two, and the condition "topology_max_dies_per_package() > 1" prevents the creation of a root domain.
In this case topology_max_dies_per_package() will return 1 and root domain will be created for partition 0 and a duplicate sysfs warning for partition 1 as both partitions have same package ID.
To address this also check for non zero partition in addition to topology_max_dies_per_package() > 1.
Signed-off-by: Srinivas Pandruvada srinivas.pandruvada@linux.intel.com Link: https://lore.kernel.org/r/20250819211034.3776284-1-srinivas.pandruvada@linux... Signed-off-by: Ilpo Järvinen ilpo.jarvinen@linux.intel.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What it fixes - Prevents duplicate sysfs root-domain creation on partitioned systems that expose only one die per package via CPU topology, which leads to a duplicate-name error and probe failure for the second partition. - The duplicate arises because both partitions share the same `package_id`, so the root-domain sysfs name “package_%02d_die_%02d” collides.
- Precise change - Adds a guard to skip creating the per-package root domain if the device is for a non-zero partition: - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- tpmi.c:713 - Changed from `if (topology_max_dies_per_package() > 1)` to `if (topology_max_dies_per_package() > 1 || plat_info->partition)`. - This ensures only partition 0 attempts the root-domain sysfs, avoiding a collision on partition 1.
- Why the issue occurs - Platform partition information is provided via TPMI (`tpmi_get_platform_data`), including `partition` and `package_id`: - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- tpmi.c:590 - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- tpmi.c:597 - The `partition` field comes from `struct oobmsm_plat_info`, where it denotes the per-package partition id: - include/linux/intel_vsec.h:164 - Root-domain sysfs naming uses `package_id` and `die_id`: - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- common.c:274 - `sprintf(data->name, "package_%02d_die_%02d", data->package_id, data->die_id);` - On partitioned systems where `topology_max_dies_per_package()` (CPUID-based) returns 1, both partition 0 and 1 attempt to create the same “package_%02d_die_%02d” entry, causing a duplicate.
- User-visible impact of the bug - The duplicate sysfs group creation fails; in the TPMI probe path this failure tears down all already-created cluster entries for that device: - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- tpmi.c:721 calls `uncore_freq_add_entry(...)` - drivers/platform/x86/intel/uncore-frequency/uncore-frequency- tpmi.c:722–723 jumps to `remove_clusters` on error, removing entries - So this is not just a warning; it can cause probe failure for the second partition, removing uncore controls for that partition.
- Why the fix is safe and minimal - One-line condition change in a single driver; no API/ABI changes. - Only alters behavior when `plat_info->partition != 0`, a case where creating the root domain would conflict. Non-partitioned systems (`partition == 0`) and multi-die systems (`topology_max_dies_per_package() > 1`) are unaffected. - The logic remains consistent with existing behavior that already skips root-domain creation on multi-die systems.
- Stable backport criteria - Fixes a real bug that affects users of partitioned platforms (duplicate sysfs + probe failure). - Small, contained change with minimal regression risk. - No architectural changes or new features; confined to `platform/x86` Intel uncore-frequency TPMI path.
Given the above, this is a clear, low-risk bug fix that prevents a probe-time failure on partitioned systems and should be backported to stable.
.../platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c index bfcf92aa4d69d..3e531fd1c6297 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c @@ -638,7 +638,7 @@ static int uncore_probe(struct auxiliary_device *auxdev, const struct auxiliary_
auxiliary_set_drvdata(auxdev, tpmi_uncore);
- if (topology_max_dies_per_package() > 1) + if (topology_max_dies_per_package() > 1 || plat_info->partition) return 0;
tpmi_uncore->root_cluster.root_domain = true;