Skip to content

Commit c49e805

Browse files
committed
tools/power/x86/intel-speed-select: Fix the condition to check multi die system
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>
1 parent d74e6e2 commit c49e805

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/power/x86/intel-speed-select/isst-config.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ static int force_online_offline;
4646
static int auto_mode;
4747
static int fact_enable_fail;
4848
static int cgroupv2;
49+
static int max_pkg_id;
4950
static int max_die_id;
50-
static int max_punit_id;
5151
static int max_die_id_package_0;
5252

5353
/* clos related */
@@ -567,7 +567,7 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
567567
}
568568

569569
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
570-
if (max_die_id == max_punit_id) {
570+
if (max_die_id > max_pkg_id) {
571571
for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
572572
id.cpu = cpus[i][k][k];
573573
id.pkg = i;
@@ -794,6 +794,8 @@ static void create_cpu_map(void)
794794
cpu_map[i].die_id = die_id;
795795
cpu_map[i].core_id = core_id;
796796

797+
if (max_pkg_id < pkg_id)
798+
max_pkg_id = pkg_id;
797799

798800
punit_id = 0;
799801

@@ -818,9 +820,6 @@ static void create_cpu_map(void)
818820
if (max_die_id < die_id)
819821
max_die_id = die_id;
820822

821-
if (max_punit_id < cpu_map[i].punit_id)
822-
max_punit_id = cpu_map[i].punit_id;
823-
824823
if (!pkg_id && max_die_id_package_0 < die_id)
825824
max_die_id_package_0 = die_id;
826825

0 commit comments

Comments
 (0)