summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/cpuidle/governors/teo.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
index 68af712f7064..30e444c9c40b 100644
--- a/drivers/cpuidle/governors/teo.c
+++ b/drivers/cpuidle/governors/teo.c
@@ -428,6 +428,14 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
break;
}
}
+
+ /*
+ * If there is a latency constraint, it may be necessary to select an
+ * idle state shallower than the current candidate one.
+ */
+ if (idx > constraint_idx)
+ idx = constraint_idx;
+
if (!idx && prev_intercept_idx) {
/*
* We have to query the sleep length here otherwise we don't
@@ -439,13 +447,6 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
}
/*
- * If there is a latency constraint, it may be necessary to select an
- * idle state shallower than the current candidate one.
- */
- if (idx > constraint_idx)
- idx = constraint_idx;
-
- /*
* Skip the timers check if state 0 is the current candidate one,
* because an immediate non-timer wakeup is expected in that case.
*/