aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/governors/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle/governors/menu.c')
-rw-r--r--drivers/cpuidle/governors/menu.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 659d7b0c9ebf..40580794e23d 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -396,8 +396,8 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
396 * power state and occurrence of the wakeup event. 396 * power state and occurrence of the wakeup event.
397 * 397 *
398 * If the entered idle state didn't support residency measurements, 398 * If the entered idle state didn't support residency measurements,
399 * we are basically lost in the dark how much time passed. 399 * we use them anyway if they are short, and if long,
400 * As a compromise, assume we slept for the whole expected time. 400 * truncate to the whole expected time.
401 * 401 *
402 * Any measured amount of time will include the exit latency. 402 * Any measured amount of time will include the exit latency.
403 * Since we are interested in when the wakeup begun, not when it 403 * Since we are interested in when the wakeup begun, not when it
@@ -405,22 +405,17 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
405 * the measured amount of time is less than the exit latency, 405 * the measured amount of time is less than the exit latency,
406 * assume the state was never reached and the exit latency is 0. 406 * assume the state was never reached and the exit latency is 0.
407 */ 407 */
408 if (unlikely(target->flags & CPUIDLE_FLAG_TIME_INVALID)) {
409 /* Use timer value as is */
410 measured_us = data->next_timer_us;
411 408
412 } else { 409 /* measured value */
413 /* Use measured value */ 410 measured_us = cpuidle_get_last_residency(dev);
414 measured_us = cpuidle_get_last_residency(dev);
415 411
416 /* Deduct exit latency */ 412 /* Deduct exit latency */
417 if (measured_us > target->exit_latency) 413 if (measured_us > target->exit_latency)
418 measured_us -= target->exit_latency; 414 measured_us -= target->exit_latency;
419 415
420 /* Make sure our coefficients do not exceed unity */ 416 /* Make sure our coefficients do not exceed unity */
421 if (measured_us > data->next_timer_us) 417 if (measured_us > data->next_timer_us)
422 measured_us = data->next_timer_us; 418 measured_us = data->next_timer_us;
423 }
424 419
425 /* Update our correction ratio */ 420 /* Update our correction ratio */
426 new_factor = data->correction_factor[data->bucket]; 421 new_factor = data->correction_factor[data->bucket];