aboutsummaryrefslogtreecommitdiff
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2006-02-28 11:25:22 -0600
committerKumar Gala <galak@kernel.crashing.org>2006-02-28 11:25:22 -0600
commit9585da3729e7e27bf22818625c10ac6c64ebb609 (patch)
tree8c8d46f7f2cc933fdf75a6a75cf593a63f7b8717 /kernel/hrtimer.c
parent8080d5497146d5d27d9e8e78229d1adc7fe280cf (diff)
parent6749c5507388f3fc3719f57a54b540ee83f6661a (diff)
Merge branch 'master' of git+ssh://galak@master.kernel.org/pub/scm/linux/kernel/git/galak/powerpc
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 2b6e1757aed..5ae51f1bc7c 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
/* Switch the timer base, if necessary: */
new_base = switch_hrtimer_base(timer, base);
- if (mode == HRTIMER_REL)
+ if (mode == HRTIMER_REL) {
tim = ktime_add(tim, new_base->get_time());
+ /*
+ * CONFIG_TIME_LOW_RES is a temporary way for architectures
+ * to signal that they simply return xtime in
+ * do_gettimeoffset(). In this case we want to round up by
+ * resolution when starting a relative timer, to avoid short
+ * timeouts. This will go away with the GTOD framework.
+ */
+#ifdef CONFIG_TIME_LOW_RES
+ tim = ktime_add(tim, base->resolution);
+#endif
+ }
timer->expires = tim;
enqueue_hrtimer(timer, new_base);