]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpuidle: Fix incorrect optimization
authorArjan van de Ven <arjan@linux.intel.com>
Sat, 8 May 2010 22:47:37 +0000 (15:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 22:03:10 +0000 (15:03 -0700)
commit2d49835cc4126fb2a029ad7a9d8804cffa2fc9f1
tree9df3d32563a2068a6cfc8eeff483853fef67a0a5
parent3fc72e6eeef7e8a1b8499886fcebd25b4deee909
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