Skip to content

Commit f926447

Browse files
spandruvadajwrdegoede
authored andcommitted
tools/power/x86/intel-speed-select: Support multiple dies
When the die id is same as punit compute die ID, treat them same. In this case, when for_each_online_power_domain_in_set() is called, then don't loop for each punit in a die. Just loop for all punits in a package. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 9ea48bd commit f926447

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +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_die_id;
50+
static int max_punit_id;
4951

5052
/* clos related */
5153
static int current_clos = -1;
@@ -562,6 +564,18 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
562564
}
563565

564566
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
567+
if (max_die_id == max_punit_id) {
568+
for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
569+
id.cpu = cpus[i][k][k];
570+
id.pkg = i;
571+
id.die = k;
572+
id.punit = k;
573+
if (isst_is_punit_valid(&id))
574+
callback(&id, arg1, arg2, arg3, arg4);
575+
}
576+
continue;
577+
}
578+
565579
for (j = 0; j < MAX_DIE_PER_PACKAGE; j++) {
566580
/*
567581
* Fix me:
@@ -795,6 +809,12 @@ static void create_cpu_map(void)
795809

796810
cpu_cnt[pkg_id][die_id][punit_id]++;
797811

812+
if (max_die_id < die_id)
813+
max_die_id = die_id;
814+
815+
if (max_punit_id < cpu_map[i].punit_id)
816+
max_punit_id = cpu_map[i].punit_id;
817+
798818
debug_printf(
799819
"map logical_cpu:%d core: %d die:%d pkg:%d punit:%d punit_cpu:%d punit_core:%d\n",
800820
i, cpu_map[i].core_id, cpu_map[i].die_id,

0 commit comments

Comments
 (0)