diff options
Diffstat (limited to 'kernel/time/timer.c')
-rw-r--r-- | kernel/time/timer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 555670a5143c..32bf6f75a8fe 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c | |||
@@ -1496,6 +1496,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) | |||
1496 | struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); | 1496 | struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); |
1497 | u64 expires = KTIME_MAX; | 1497 | u64 expires = KTIME_MAX; |
1498 | unsigned long nextevt; | 1498 | unsigned long nextevt; |
1499 | bool is_max_delta; | ||
1499 | 1500 | ||
1500 | /* | 1501 | /* |
1501 | * Pretend that there is no timer pending if the cpu is offline. | 1502 | * Pretend that there is no timer pending if the cpu is offline. |
@@ -1506,6 +1507,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) | |||
1506 | 1507 | ||
1507 | spin_lock(&base->lock); | 1508 | spin_lock(&base->lock); |
1508 | nextevt = __next_timer_interrupt(base); | 1509 | nextevt = __next_timer_interrupt(base); |
1510 | is_max_delta = (nextevt == base->clk + NEXT_TIMER_MAX_DELTA); | ||
1509 | base->next_expiry = nextevt; | 1511 | base->next_expiry = nextevt; |
1510 | /* | 1512 | /* |
1511 | * We have a fresh next event. Check whether we can forward the base: | 1513 | * We have a fresh next event. Check whether we can forward the base: |
@@ -1519,7 +1521,8 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) | |||
1519 | expires = basem; | 1521 | expires = basem; |
1520 | base->is_idle = false; | 1522 | base->is_idle = false; |
1521 | } else { | 1523 | } else { |
1522 | expires = basem + (nextevt - basej) * TICK_NSEC; | 1524 | if (!is_max_delta) |
1525 | expires = basem + (nextevt - basej) * TICK_NSEC; | ||
1523 | /* | 1526 | /* |
1524 | * If we expect to sleep more than a tick, mark the base idle: | 1527 | * If we expect to sleep more than a tick, mark the base idle: |
1525 | */ | 1528 | */ |