Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85515
b: refs/heads/master
c: 63070a7
h: refs/heads/master
i:
  85513: 1885db8
  85511: 95d607b
v: v3
  • Loading branch information
Thomas Gleixner committed Feb 14, 2008
1 parent 7603ee9 commit dcb22c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a7780e725d1bb4c3094fcc12f1c5c5faea1e988
refs/heads/master: 63070a79ba482c274bad10ac8c4b587a3e011f2c
11 changes: 11 additions & 0 deletions trunk/kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ static int hrtimer_reprogram(struct hrtimer *timer,
ktime_t expires = ktime_sub(timer->expires, base->offset);
int res;

WARN_ON_ONCE(timer->expires.tv64 < 0);

/*
* When the callback is running, we do not reprogram the clock event
* device. The timer callback is either running on a different CPU or
Expand All @@ -452,6 +454,15 @@ static int hrtimer_reprogram(struct hrtimer *timer,
if (hrtimer_callback_running(timer))
return 0;

/*
* CLOCK_REALTIME timer might be requested with an absolute
* expiry time which is less than base->offset. Nothing wrong
* about that, just avoid to call into the tick code, which
* has now objections against negative expiry values.
*/
if (expires.tv64 < 0)
return -ETIME;

if (expires.tv64 >= expires_next->tv64)
return 0;

Expand Down

0 comments on commit dcb22c4

Please sign in to comment.