Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Huang Rui and committed by
Shuah Khan
083792f3 46c273a0

+13
+13
tools/power/cpupower/utils/helpers/cpuid.c
··· 149 149 if (ext_cpuid_level >= 0x80000008 && 150 150 cpuid_ebx(0x80000008) & (1 << 4)) 151 151 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 + } 152 165 } 153 166 154 167 if (cpu_info->vendor == X86_VENDOR_INTEL) {