Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269182
b: refs/heads/master
c: 54da23b
h: refs/heads/master
v: v3
  • Loading branch information
John Stultz committed Aug 10, 2011
1 parent 2168f33 commit b29cd02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b41308d2d0398409620613c7eaaaf52c738b042
refs/heads/master: 54da23b720d5d612f8f1669f9ed3744008fb7382
20 changes: 13 additions & 7 deletions trunk/kernel/time/alarmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
unsigned long flags;
ktime_t now;
int ret = HRTIMER_NORESTART;
int restart = ALARMTIMER_NORESTART;

spin_lock_irqsave(&base->lock, flags);
now = base->gettime();
Expand All @@ -188,16 +189,16 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)

timerqueue_del(&base->timerqueue, &alarm->node);
alarm->enabled = 0;
/* Re-add periodic timers */
if (alarm->period.tv64) {
alarm->node.expires = ktime_add(expired, alarm->period);
timerqueue_add(&base->timerqueue, &alarm->node);
alarm->enabled = 1;
}

spin_unlock_irqrestore(&base->lock, flags);
if (alarm->function)
alarm->function(alarm, now);
restart = alarm->function(alarm, now);
spin_lock_irqsave(&base->lock, flags);

if (restart != ALARMTIMER_NORESTART) {
timerqueue_add(&base->timerqueue, &alarm->node);
alarm->enabled = 1;
}
}

if (next) {
Expand Down Expand Up @@ -373,6 +374,11 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
if (posix_timer_event(ptr, 0) != 0)
ptr->it_overrun++;

/* Re-add periodic timers */
if (alarm->period.tv64) {
alarm->node.expires = ktime_add(now, alarm->period);
return ALARMTIMER_RESTART;
}
return ALARMTIMER_NORESTART;
}

Expand Down

0 comments on commit b29cd02

Please sign in to comment.