Even when there is no die exported by CPUID leaf 0x1F, the kernel version
after 6.9 will show non zero die_id in the sysfs. In that case maximum
die_id can still match maximum power domain ID. So the condition to check
if the power domain ID is same a die_id to prevent duplicate display
doesn't hold true.
The better condition is to check if the maximum die_id is more than the
maximum package_id. If the die_id is exposed by CPUID leaf 0x1F, the
maximum die_id will be more than maximum package_id.
With this change tracking of max_punit_id is not used, so remove storing
max_punit_id.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
static int auto_mode;
static int fact_enable_fail;
static int cgroupv2;
+static int max_pkg_id;
static int max_die_id;
-static int max_punit_id;
static int max_die_id_package_0;
/* clos related */
}
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
- if (max_die_id == max_punit_id) {
+ if (max_die_id > max_pkg_id) {
for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
id.cpu = cpus[i][k][k];
id.pkg = i;
cpu_map[i].die_id = die_id;
cpu_map[i].core_id = core_id;
+ if (max_pkg_id < pkg_id)
+ max_pkg_id = pkg_id;
punit_id = 0;
if (max_die_id < die_id)
max_die_id = die_id;
- if (max_punit_id < cpu_map[i].punit_id)
- max_punit_id = cpu_map[i].punit_id;
-
if (!pkg_id && max_die_id_package_0 < die_id)
max_die_id_package_0 = die_id;