summaryrefslogtreecommitdiff
path: root/tools/power/x86
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2024-03-08 02:47:11 +0300
committerHans de Goede <hdegoede@redhat.com>2024-04-29 14:31:49 +0300
commitf9264471337e1db69ffc97525bff605b8c7c442f (patch)
treee396c783289fae43ea2587a2abe2d822e9955f9c /tools/power/x86
parent9ea48bdfd5b19a81edfd9dcc12b8af6bb319c6d8 (diff)
downloadlinux-f9264471337e1db69ffc97525bff605b8c7c442f.tar.xz
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 <srinivas.pandruvada@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'tools/power/x86')
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index d865dc1f89ee..54c50124303e 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -46,6 +46,8 @@ static int force_online_offline;
static int auto_mode;
static int fact_enable_fail;
static int cgroupv2;
+static int max_die_id;
+static int max_punit_id;
/* clos related */
static int current_clos = -1;
@@ -562,6 +564,18 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
}
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
+ if (max_die_id == max_punit_id) {
+ for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
+ id.cpu = cpus[i][k][k];
+ id.pkg = i;
+ id.die = k;
+ id.punit = k;
+ if (isst_is_punit_valid(&id))
+ callback(&id, arg1, arg2, arg3, arg4);
+ }
+ continue;
+ }
+
for (j = 0; j < MAX_DIE_PER_PACKAGE; j++) {
/*
* Fix me:
@@ -795,6 +809,12 @@ static void create_cpu_map(void)
cpu_cnt[pkg_id][die_id][punit_id]++;
+ 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;
+
debug_printf(
"map logical_cpu:%d core: %d die:%d pkg:%d punit:%d punit_cpu:%d punit_core:%d\n",
i, cpu_map[i].core_id, cpu_map[i].die_id,