|
@@ -850,6 +850,14 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
|
|
#ifdef CONFIG_TIME_LOW_RES
|
|
#ifdef CONFIG_TIME_LOW_RES
|
|
tim = ktime_add(tim, base->resolution);
|
|
tim = ktime_add(tim, base->resolution);
|
|
#endif
|
|
#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;
|
|
timer->expires = tim;
|
|
|
|
|