cpupower: Fix amd cpu (family < 0x17) active state issue
Quoted 9 lines · 徐福海
From: xufuhai<[email protected]>
For the old AMD processor (family <
0x17), cpupower will call theamd_pci_get_num_boost_statesfunction, but for the non-root userpci_read_bytefunction (implementation comes from the psutil library), val will be set to0xff, indicating that there is no read function callback. At this time, the original logic will set the cpupower turbo active state to yes. This is an obvious issue~
Quoted 5 lines
Reproduce procedure:
cpupower frequency-infoReported-by yangrui<[email protected]>Signed-off-by xufuhai<[email protected]>
Also your Signed-off-by should match the from address. There is a mismatch between the two.
Quoted 28 lines
Signed-off-by chenguanqiao<[email protected]>Signed-off-by lishujin<[email protected]>Reviewed-by Thomas Renninger<[email protected]>--- tools/power/cpupower/utils/helpers/amd.c | 7 +++++++ 1 file changed, 7 insertions(+)tools/power/cpupower/utils/helpers/amd.c +7
-0@@ -137,6 +137,13 @@ int amd_pci_get_num_boost_states(int *active, int *states)return -ENODEV ; val =pci_read_byte (device,0x15c ); + +/* If val is 0xff, meaning has no permisson to +* get the boost states, return -1 +*/ +if (val ==0xff ) +return -1 ; +if (val &3 ) *active =1 ;else Signature · 1 line
2.24.3 (Apple Git-128)
I am seeing two patches with the same commit summary, should these two be a singles patch?
https://patchwork.kernel.org/project/linux-pm/patch/[email protected]/
Please combine the two and send single patch if they fix the same problem. If not, please change the commit log to reflect the difference.
thanks,
-- Shuah
okay, I believe the two patches are for fixing defferent issue, I will update my patches as your mention
THANKS
Quoted 60 lines · Shuah Khan
Quoted 9 lines · 徐福海
From: xufuhai<[email protected]>
For the old AMD processor (family <
0x17), cpupower will call theamd_pci_get_num_boost_statesfunction, but for the non-root userpci_read_bytefunction (implementation comes from the psutil library), val will be set to0xff, indicating that there is no read function callback. At this time, the original logic will set the cpupower turbo active state to yes. This is an obvious issue~Quoted 5 lines
Reproduce procedure:
cpupower frequency-infoReported-by yangrui<[email protected]>Signed-off-by xufuhai<[email protected]>Also your Signed-off-by should match the from address. There is a mismatch between the two.
Quoted 23 lines
Signed-off-by chenguanqiao<[email protected]>Signed-off-by lishujin<[email protected]>Reviewed-by Thomas Renninger<[email protected]>---
tools/power/cpupower/utils/helpers/amd.c| 7 +++++++1 file changed, 7 insertions(+)tools/power/cpupower/utils/helpers/amd.c +7
-0@@ -137,6 +137,13 @@ int amd_pci_get_num_boost_states(int *active, int *states) return -ENODEV; val = pci_read_byte(device, 0x15c); + + /* If val is 0xff, meaning has no permisson to + * get the boost states, return -1 + */ + if (val == 0xff) + return -1; + if (val & 3) *active = 1;Quoted 4 lines
else
--
2.24.3 (Apple Git-128)I am seeing two patches with the same commit summary, should these two be a singles patch?
https://patchwork.kernel.org/project/linux-pm/patch/[email protected]/
Please combine the two and send single patch if they fix the same problem. If not, please change the commit log to reflect the difference.
thanks,
-- Shuah