cpuidle: Fix incorrect optimization
commit878ab0f7c084d22ecbca25953907f637474c70d9
authorArjan van de Ven <arjan@linux.intel.com>
Sat, 8 May 2010 22:47:37 +0000 (8 15:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 21:57:16 +0000 (12 14:57 -0700)
tree1afc07fb2d0562c1d2b68278f8484410d643a39e
parent8c75d08fd187685d67994a364a58875429d7d15a
cpuidle: Fix incorrect optimization

commit 1c6fe0364fa7bf28248488753ee0afb6b759cd04 upstream.

commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit")
added an optimization, where the analysis on the past idle period moved
from the end of idle, to the beginning of the new idle.

Unfortunately, this optimization had a bug where it zeroed one key
variable for new use, that is needed for the analysis.  The fix is
simple, zero the variable after doing the work from the previous idle.

During the audit of the code that found this issue, another issue was
also found; the ->measured_us data structure member is never set, a
local variable is always used instead.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/cpuidle/governors/menu.c