summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2013-08-14 20:02:34 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-23 02:24:15 +0400
commit330647a9501fe8f93a8ae9361417e51ee0bebd7e (patch)
tree45c364ac0efbe01caee7ee41ca9b6b5c5b25d029 /drivers/cpuidle
parent81455e72211e41972cca1d4686bc07b2e93b81e1 (diff)
downloadlinux-330647a9501fe8f93a8ae9361417e51ee0bebd7e.tar.xz
cpuidle: Ignore interval prediction result when timer is shorter
This patch prevents cpuidle menu governor from using repeating interval prediction result if the idle period predicted is longer than the one allowed by shortest running timer. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/governors/menu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index cbbb73b37a6d..351697305fe7 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -238,10 +238,13 @@ again:
*
* The typical interval is obtained when standard deviation is small
* or standard deviation is small compared to the average interval.
+ *
+ * Use this result only if there is no timer to wake us up sooner.
*/
if (((avg > stddev * 6) && (divisor * 4 >= INTERVALS * 3))
|| stddev <= 20) {
- data->predicted_us = avg;
+ if (data->expected_us > avg)
+ data->predicted_us = avg;
return;
} else if ((divisor * 4) > INTERVALS * 3) {