aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-07 14:01:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-07 14:01:26 -0500
commit2c5ea0f2d8c7d4883dd0d8ec3c7e3f3640b4f814 (patch)
treef6412441325195c16351822cff8da5f2ed5f1cfe /kernel
parentfa2dd441df28b9fdfc68f84ae66f1b507cfff0e4 (diff)
parente17bcb43a26a7111f851b5ff6d1258ecd355de75 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: ACPI: move timer broadcast before busmaster disable clockevents: warn once when program_event() is called with negative expiry hrtimers: avoid overflow for large relative timeouts
Diffstat (limited to 'kernel')
-rw-r--r--kernel/hrtimer.c8
-rw-r--r--kernel/time/clockevents.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 22a25142e4cf..e65dd0b47cdc 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -850,6 +850,14 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
850#ifdef CONFIG_TIME_LOW_RES 850#ifdef CONFIG_TIME_LOW_RES
851 tim = ktime_add(tim, base->resolution); 851 tim = ktime_add(tim, base->resolution);
852#endif 852#endif
853 /*
854 * Careful here: User space might have asked for a
855 * very long sleep, so the add above might result in a
856 * negative number, which enqueues the timer in front
857 * of the queue.
858 */
859 if (tim.tv64 < 0)
860 tim.tv64 = KTIME_MAX;
853 } 861 }
854 timer->expires = tim; 862 timer->expires = tim;
855 863
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 822beebe664a..5fb139fef9fa 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -78,6 +78,11 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
78 unsigned long long clc; 78 unsigned long long clc;
79 int64_t delta; 79 int64_t delta;
80 80
81 if (unlikely(expires.tv64 < 0)) {
82 WARN_ON_ONCE(1);
83 return -ETIME;
84 }
85
81 delta = ktime_to_ns(ktime_sub(expires, now)); 86 delta = ktime_to_ns(ktime_sub(expires, now));
82 87
83 if (delta <= 0) 88 if (delta <= 0)