• Arjan van de Ven's avatar
    cpuidle: Fix incorrect optimization · 1c6fe036
    Arjan van de Ven authored
    commit 672917dc ("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: default avatarArjan van de Ven <arjan@linux.intel.com>
    Cc: Corrado Zoccolo <czoccolo@gmail.com>
    Cc: stable@kernel.org
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1c6fe036
menu.c 9.99 KB