Skip to content

Commit 083792f

Browse files
huangruishuahkh
authored andcommitted
cpupower: Initial AMD P-State capability
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. Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 46c273a commit 083792f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • tools/power/cpupower/utils/helpers

tools/power/cpupower/utils/helpers/cpuid.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,19 @@ int get_cpu_info(struct cpupower_cpu_info *cpu_info)
149149
if (ext_cpuid_level >= 0x80000008 &&
150150
cpuid_ebx(0x80000008) & (1 << 4))
151151
cpu_info->caps |= CPUPOWER_CAP_AMD_RDPRU;
152+
153+
if (cpupower_amd_pstate_enabled()) {
154+
cpu_info->caps |= CPUPOWER_CAP_AMD_PSTATE;
155+
156+
/*
157+
* If AMD P-State is enabled, the firmware will treat
158+
* AMD P-State function as high priority.
159+
*/
160+
cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB;
161+
cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB_MSR;
162+
cpu_info->caps &= ~CPUPOWER_CAP_AMD_HW_PSTATE;
163+
cpu_info->caps &= ~CPUPOWER_CAP_AMD_PSTATEDEF;
164+
}
152165
}
153166

154167
if (cpu_info->vendor == X86_VENDOR_INTEL) {

0 commit comments

Comments
 (0)