From: Srinivas Pandruvada Date: Wed, 5 Mar 2025 19:01:56 +0000 (-0800) Subject: tools/power/x86/intel-speed-select: Fix the condition to check multi die system X-Git-Tag: v6.15-rc1~172^2~5^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c49e805db30674293d6a595db52549addd9d611f;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index c319bfc3b7cba..545e9e88f9986 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -46,8 +46,8 @@ static int force_online_offline; 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 */ @@ -567,7 +567,7 @@ 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) { + 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; @@ -794,6 +794,8 @@ static void create_cpu_map(void) 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; @@ -818,9 +820,6 @@ static void create_cpu_map(void) 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;