From 9e203bcc1051cac2a8b15c3ee9db4c0d05794abe Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 24 Feb 2007 22:10:13 -0800 Subject: [TIME] tick-sched: Add missing asm/irq_regs.h include. Acked-by: Thomas Gleixner Signed-off-by: David S. Miller --- kernel/time/tick-sched.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 512a4a90646..51556b95f60 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -21,6 +21,8 @@ #include #include +#include + #include "tick-internal.h" /* -- cgit v1.2.3-70-g09d2 From 3494c16676a21e7e53e21b08a0a469a38df6dcfb Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 24 Feb 2007 22:11:42 -0800 Subject: [TICK] tick-common: Fix one-shot handling in tick_handle_periodic(). When clockevents_program_event() is given an expire time in the past, it does not update dev->next_event, so this looping code would loop forever once the first in-the-past expiration time was used. Keep advancing "next" locally to fix this bug. Acked-by: Thomas Gleixner Signed-off-by: David S. Miller --- kernel/time/tick-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 4500e347f1b..0986a2bfab4 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -77,6 +77,7 @@ static void tick_periodic(int cpu) void tick_handle_periodic(struct clock_event_device *dev) { int cpu = smp_processor_id(); + ktime_t next; tick_periodic(cpu); @@ -86,12 +87,12 @@ void tick_handle_periodic(struct clock_event_device *dev) * Setup the next period for devices, which do not have * periodic mode: */ + next = ktime_add(dev->next_event, tick_period); for (;;) { - ktime_t next = ktime_add(dev->next_event, tick_period); - if (!clockevents_program_event(dev, next, ktime_get())) return; tick_periodic(cpu); + next = ktime_add(next, tick_period); } } -- cgit v1.2.3-70-g09d2