]> git.baikalelectronics.ru Git - kernel.git/commit
tools: cpupower: fix return checks for sysfs_get_idlestate_count()
authorPrarit Bhargava <prarit@redhat.com>
Mon, 1 Dec 2014 14:39:22 +0000 (09:39 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Dec 2014 02:12:34 +0000 (03:12 +0100)
commit67c52b83bd1c9e9ddc4f5126214679dc22275ef9
treec7b170c8eab5c804e5fd74958e22b76c4cb0b880
parentba45561728c20faf2120fe597ce796d19e8b6a88
tools: cpupower: fix return checks for sysfs_get_idlestate_count()

Red Hat and Fedora use a bug reporting tool that gathers data about
"broken" systems called sosreport.  Among other things, it includes the
output of 'cpupower idle-info'.  Executing 'cpupower idle-info' on a
system that has cpuidle disabled via 'cpuidle.off=1' results in a 300
second hang in the cpupower application.

ie)
[root@intel-brickland-05]# cpupower idle-info
Could not determine cpuidle driver

Analyzing CPU 0:
Number of idle states: -19
[hang]

The problem is that the cpupower code only checks for a zero return from
sysfs_get_idlestate_count().  The function can return -ENODEV (-19) as
above.  This patch fixes callers to sysfs_get_idlestate_count() to check
the right return values.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/power/cpupower/utils/cpuidle-info.c