提交 c9af8dec 编写于 作者: N Nathan Fontenot 提交者: Zheng Zengkai

cpupower: Condense pstate enabled bit checks in decode_pstates()

mainline inclusion
from mainline-5.12-rc1-dontuse
commit 56a85eeb
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QQWF

--------------------------------

The enabled bit (bit 63) is common for all families so we can remove
the multiple enabled checks based on family and have a common check
for HW pstate enabled.
Signed-off-by: NNathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: NRobert Richter <rrichter@amd.com>
Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Nqinyu <qinyu16@huawei.com>
Reviewed-by: NChao Liu <liuchao173@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a38039dc
......@@ -113,9 +113,9 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family,
}
if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val))
return -1;
if ((cpu_family == 0x17) && (!pstate.pstatedef.en))
continue;
else if (!pstate.pstate.en)
/* The enabled bit (bit 63) is common for all families */
if (!pstate.pstatedef.en)
continue;
pstates[i] = get_cof(cpu_family, pstate);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册