提交 e98f033f 编写于 作者: J Jacob Tanenbaum 提交者: Rafael J. Wysocki

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: NJacob Tanenbaum <jtanenba@redhat.com>
Signed-off-by: NThomas Renninger <trenn@suse.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 562e5f1a
...@@ -434,8 +434,8 @@ static int get_latency(unsigned int cpu, unsigned int human) ...@@ -434,8 +434,8 @@ static int get_latency(unsigned int cpu, unsigned int human)
unsigned long latency = cpufreq_get_transition_latency(cpu); unsigned long latency = cpufreq_get_transition_latency(cpu);
printf(_(" maximum transition latency: ")); printf(_(" maximum transition latency: "));
if (!latency) { if (!latency || latency == UINT_MAX) {
printf(_(" Cannot determine latency.\n")); printf(_(" Cannot determine or is not supported.\n"));
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册