diff options
author | Jacob Tanenbaum <jtanenba@redhat.com> | 2015-12-01 11:14:17 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-02 20:30:30 -0500 |
commit | e98f033f94f385a9cf498d4e9f2ac1e6198b545a (patch) | |
tree | b461a9ef90be234d203f29cf935a72d91064e5f1 | |
parent | 562e5f1a352977f45d0d0ed3279b556d3e41e1ba (diff) |
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 <jtanenba@redhat.com>
Signed-off-by: Thomas Renninger <trenn@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | tools/power/cpupower/utils/cpufreq-info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index c13bc8c7c860..8f3f5bb9c74e 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c | |||
@@ -434,8 +434,8 @@ static int get_latency(unsigned int cpu, unsigned int human) | |||
434 | unsigned long latency = cpufreq_get_transition_latency(cpu); | 434 | unsigned long latency = cpufreq_get_transition_latency(cpu); |
435 | 435 | ||
436 | printf(_(" maximum transition latency: ")); | 436 | printf(_(" maximum transition latency: ")); |
437 | if (!latency) { | 437 | if (!latency || latency == UINT_MAX) { |
438 | printf(_(" Cannot determine latency.\n")); | 438 | printf(_(" Cannot determine or is not supported.\n")); |
439 | return -EINVAL; | 439 | return -EINVAL; |
440 | } | 440 | } |
441 | 441 | ||