mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
cpupower: fix how "cpupower frequency-info" interprets latency
the intel-pstate driver does not support the ondemand governor and does not have a valid value in /sys/devices/system/cpu/cpu[x]/cpufreq/cpuinfo_transition_latency. The intel-pstate driver sets cpuinfo_transition_latency to CPUFREQ_ETERNAL (-1), the value written into cpuinfo_transition_latency is defind as an unsigned int so checking the read value against max unsigned int will determine if the value is valid. Signed-off-by: Jacob Tanenbaum <[email protected]> Signed-off-by: Thomas Renninger <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
1 parent
562e5f1a35
commit
e98f033f94
1 file changed
+2
-2
@@ -434,8 +434,8 @@ static int get_latency(unsigned int cpu, unsigned int human)
|
||||
unsigned long latency = cpufreq_get_transition_latency(cpu);
|
||||
|
||||
printf(_(" maximum transition latency: "));
|
||||
if (!latency) {
|
||||
printf(_(" Cannot determine latency.\n"));
|
||||
if (!latency || latency == UINT_MAX) {
|
||||
printf(_(" Cannot determine or is not supported.\n"));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user