]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/hrtimer.c
ARM: OMAP3: update clk_wait_ready() for OMAP3 DSS clocks
[linux-2.6-omap-h63xx.git] / kernel / hrtimer.c
index 22a25142e4cf923967d770ef23a7992d1b19ff42..e65dd0b47cdc13a31abc762315152cb49edea8d8 100644 (file)
@@ -850,6 +850,14 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
 #ifdef CONFIG_TIME_LOW_RES
                tim = ktime_add(tim, base->resolution);
 #endif
+               /*
+                * Careful here: User space might have asked for a
+                * very long sleep, so the add above might result in a
+                * negative number, which enqueues the timer in front
+                * of the queue.
+                */
+               if (tim.tv64 < 0)
+                       tim.tv64 = KTIME_MAX;
        }
        timer->expires = tim;