Skip to content

Commit

Permalink
cpupower: Initial AMD P-State capability
Browse files Browse the repository at this point in the history
If kernel starts the AMD P-State module, the cpupower will initial the
capability flag as CPUPOWER_CAP_AMD_PSTATE. And once AMD P-State
capability is set, it won't need to set legacy ACPI relative
capabilities anymore.

Signed-off-by: Huang Rui <ray.huang@amd.com>
  • Loading branch information
huangrui authored and xanmod committed Feb 23, 2022
1 parent 4fe6d24 commit 6e70164
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/power/cpupower/utils/helpers/cpuid.c
Expand Up @@ -149,6 +149,19 @@ int get_cpu_info(struct cpupower_cpu_info *cpu_info)
if (ext_cpuid_level >= 0x80000008 &&
cpuid_ebx(0x80000008) & (1 << 4))
cpu_info->caps |= CPUPOWER_CAP_AMD_RDPRU;

if (cpupower_amd_pstate_enabled()) {
cpu_info->caps |= CPUPOWER_CAP_AMD_PSTATE;

/*
* If AMD P-State is enabled, the firmware will treat
* AMD P-State function as high priority.
*/
cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB;
cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB_MSR;
cpu_info->caps &= ~CPUPOWER_CAP_AMD_HW_PSTATE;
cpu_info->caps &= ~CPUPOWER_CAP_AMD_PSTATEDEF;
}
}

if (cpu_info->vendor == X86_VENDOR_INTEL) {
Expand Down

0 comments on commit 6e70164

Please sign in to comment.