aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-12 05:47:34 -0500
committerThomas Gleixner <tglx@linutronix.de>2006-01-12 05:47:34 -0500
commitc9db4fa11526affde83603fe52595bd1260c1354 (patch)
tree3064d71209b32569cfbd5dd0907fbe65bcf02d5e /kernel/hrtimer.c
parente2787630c1abb075c935cf47e91beb7c656f48c4 (diff)
[hrtimer] Enforce resolution as lower limit of intervals
Roman Zippel pointed out that the missing lower limit of intervals leads to an accounting error in the overrun count. Enforce the lower limit of intervals to resolution in the timer forwarding code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 76d759ce6231..04ccab099e84 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -275,7 +275,7 @@ void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
275 * The number of overruns is added to the overrun field. 275 * The number of overruns is added to the overrun field.
276 */ 276 */
277unsigned long 277unsigned long
278hrtimer_forward(struct hrtimer *timer, const ktime_t interval) 278hrtimer_forward(struct hrtimer *timer, ktime_t interval)
279{ 279{
280 unsigned long orun = 1; 280 unsigned long orun = 1;
281 ktime_t delta, now; 281 ktime_t delta, now;
@@ -287,6 +287,9 @@ hrtimer_forward(struct hrtimer *timer, const ktime_t interval)
287 if (delta.tv64 < 0) 287 if (delta.tv64 < 0)
288 return 0; 288 return 0;
289 289
290 if (interval.tv64 < timer->base->resolution.tv64)
291 interval.tv64 = timer->base->resolution.tv64;
292
290 if (unlikely(delta.tv64 >= interval.tv64)) { 293 if (unlikely(delta.tv64 >= interval.tv64)) {
291 nsec_t incr = ktime_to_ns(interval); 294 nsec_t incr = ktime_to_ns(interval);
292 295