summaryrefslogtreecommitdiffstats
path: root/tools/power/x86/intel-speed-select/isst-config.c
diff options
context:
space:
mode:
authorJonathan Doman <jonathan.doman@intel.com>2020-09-30 15:26:36 -0700
committerHans de Goede <hdegoede@redhat.com>2020-10-07 22:54:16 +0200
commit7566616fb968dcc9f11d3f6b57132d33acab4e35 (patch)
treeb12004573479904f0512834777a0337eb3474d9d /tools/power/x86/intel-speed-select/isst-config.c
parent81c93798ef3ebd2109dc24371db3cc14cdf77777 (diff)
downloadlinux-7566616fb968dcc9f11d3f6b57132d33acab4e35.tar.bz2
tools/power/x86/intel-speed-select: Fix missing base-freq core IDs
The reported base-freq high-priority-cpu-list was potentially omitting some cpus, due to incorrectly using a logical core count to constrain the size of a physical punit core ID mask. We may need to read both high and low PBF CORE_MASK values regardless of the logical core count. Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> 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/intel-speed-select/isst-config.c')
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 9f4b190f1d74..0bba5be8d1fd 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -545,20 +545,23 @@ static void set_cpu_present_cpu_mask(void)
}
}
-int get_core_count(int pkg_id, int die_id)
+int get_max_punit_core_id(int pkg_id, int die_id)
{
- int cnt = 0;
+ int max_id = 0;
+ int i;
- if (pkg_id < MAX_PACKAGE_COUNT && die_id < MAX_DIE_PER_PACKAGE) {
- int i;
+ for (i = 0; i < topo_max_cpus; ++i)
+ {
+ if (!CPU_ISSET_S(i, present_cpumask_size, present_cpumask))
+ continue;
- for (i = 0; i < sizeof(long long) * 8; ++i) {
- if (core_mask[pkg_id][die_id] & (1ULL << i))
- cnt++;
- }
+ if (cpu_map[i].pkg_id == pkg_id &&
+ cpu_map[i].die_id == die_id &&
+ cpu_map[i].punit_cpu_core > max_id)
+ max_id = cpu_map[i].punit_cpu_core;
}
- return cnt;
+ return max_id;
}
int get_cpu_count(int pkg_id, int die_id)