summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/governors/teo.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-10-10 23:32:17 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-10-14 10:40:32 +0200
commit069ce2ef1a6dd84cbd4d897b333e30f825e021f0 (patch)
tree18ac98cd6a289dc72db9459babc7f09772addc7e /drivers/cpuidle/governors/teo.c
parent4f5cafb5cb8471e54afdc9054d973535614f7675 (diff)
downloadlinux-069ce2ef1a6dd84cbd4d897b333e30f825e021f0.tar.bz2
cpuidle: teo: Ignore disabled idle states that are too deep
Prevent disabled CPU idle state with target residencies beyond the anticipated idle duration from being taken into account by the TEO governor. Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: 5.1+ <stable@vger.kernel.org> # 5.1+
Diffstat (limited to 'drivers/cpuidle/governors/teo.c')
-rw-r--r--drivers/cpuidle/governors/teo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
index b5a0e498f798..8806db95a913 100644
--- a/drivers/cpuidle/governors/teo.c
+++ b/drivers/cpuidle/governors/teo.c
@@ -258,6 +258,13 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
if (s->disabled || su->disable) {
/*
+ * Ignore disabled states with target residencies beyond
+ * the anticipated idle duration.
+ */
+ if (s->target_residency > duration_us)
+ continue;
+
+ /*
* If the "early hits" metric of a disabled state is
* greater than the current maximum, it should be taken
* into account, because it would be a mistake to select