diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2019-11-04 03:02:45 -0800 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-11-07 19:00:25 +0200 |
commit | de7f9d3ddc8c71a116fbdfa298a19abd8d46e696 (patch) | |
tree | 17d82ad82d2842e880a126998e208475d665fdb0 /tools/power/x86/intel-speed-select/isst-core.c | |
parent | 7af5a95bb752702bfc91fc513d37f1f799e6fd1f (diff) | |
download | linux-de7f9d3ddc8c71a116fbdfa298a19abd8d46e696.tar.bz2 |
tools/power/x86/intel-speed-select: Use core count for base-freq mask
Some firmware implementation gives error when a command is sent get mask
for core count 32-61. So use core count to decide.
But there is no function to get core count. So introduce one function to
get core count.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'tools/power/x86/intel-speed-select/isst-core.c')
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c index 8b3e1c7abb42..52698553de92 100644 --- a/tools/power/x86/intel-speed-select/isst-core.c +++ b/tools/power/x86/intel-speed-select/isst-core.c @@ -335,12 +335,15 @@ int isst_set_tdp_level(int cpu, int tdp_level) int isst_get_pbf_info(int cpu, int level, struct isst_pbf_info *pbf_info) { + int i, ret, core_cnt, max; unsigned int req, resp; - int i, ret; pbf_info->core_cpumask_size = alloc_cpu_set(&pbf_info->core_cpumask); - for (i = 0; i < 2; ++i) { + core_cnt = get_core_count(get_physical_package_id(cpu), get_physical_die_id(cpu)); + max = core_cnt > 32 ? 2 : 1; + + for (i = 0; i < max; ++i) { unsigned long long mask; int count; |