cpuidle: Fix incorrect optimization
authorArjan van de Ven <arjan@linux.intel.com>
Sat, 8 May 2010 22:47:37 +0000 (15:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 May 2010 01:35:36 +0000 (18:35 -0700)
commit1c6fe0364fa7bf28248488753ee0afb6b759cd04
tree8bb0caf5efc652c18354a8694fc1e235f216d6ab
parentf1c448e0a9e99c76f4ece368714fb35a40a8daba
cpuidle: Fix incorrect optimization

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>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/cpuidle/governors/menu.c