aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/cpufreq-info.c
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2022-02-22 23:34:25 +0800
committerShuah Khan <skhan@linuxfoundation.org>2022-02-22 18:37:12 -0700
commitd8363e29178249bb505ae388ce1658484396fcde (patch)
treed3d99102548486f6f52b8e70952f1efa927ac088 /tools/power/cpupower/utils/cpufreq-info.c
parentcpupower: Move print_speed function into misc helper (diff)
downloadlinux-dev-d8363e29178249bb505ae388ce1658484396fcde.tar.xz
linux-dev-d8363e29178249bb505ae388ce1658484396fcde.zip
cpupower: Add function to print AMD P-State performance capabilities
AMD P-State kernel module is using the fine grain frequency instead of acpi hardware pstate. So add a function to print performance and frequency values. Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/power/cpupower/utils/cpufreq-info.c')
-rw-r--r--tools/power/cpupower/utils/cpufreq-info.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
index b429454bf3ae..235243ec5ce0 100644
--- a/tools/power/cpupower/utils/cpufreq-info.c
+++ b/tools/power/cpupower/utils/cpufreq-info.c
@@ -146,9 +146,12 @@ static int get_boost_mode_x86(unsigned int cpu)
printf(_(" Supported: %s\n"), support ? _("yes") : _("no"));
printf(_(" Active: %s\n"), active ? _("yes") : _("no"));
- if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
- cpupower_cpu_info.family >= 0x10) ||
- cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
+ if (cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
+ cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATE) {
+ return 0;
+ } else if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
+ cpupower_cpu_info.family >= 0x10) ||
+ cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
ret = decode_pstates(cpu, b_states, pstates, &pstate_no);
if (ret)
return ret;