summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman2010-03-11 23:57:35 +0100
committerKevin Hilman2010-04-06 00:25:11 +0200
commitd99c3871148cb643cffe138e9427b7a743aca367 (patch)
treec8c9f16f963263dce4ed72d814d72cb93ed481ee
parentLinux 2.6.34-rc3 (diff)
downloadkernel-qcow2-linux-d99c3871148cb643cffe138e9427b7a743aca367.tar.gz
kernel-qcow2-linux-d99c3871148cb643cffe138e9427b7a743aca367.tar.xz
kernel-qcow2-linux-d99c3871148cb643cffe138e9427b7a743aca367.zip
davinci: timers: don't enable timer until clocksource is initialized
On da830, when the same timer is used for clocksource and clockevent, the timer can be started before the clockevent is registered/initialzed. This creates a window where a timer interrupt might fire before the clockevent handler has been setup and causes a crash. This patch moves the actual enable/start of the timer after the clockevent has ben registered. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/mach-davinci/time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 42d985beece5..9e0b106b4f5f 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -253,8 +253,6 @@ static void __init timer_init(void)
irq = USING_COMPARE(t) ? dtip[i].cmp_irq : irq;
setup_irq(irq, &t->irqaction);
}
-
- timer32_config(&timers[i]);
}
}
@@ -331,6 +329,7 @@ static void __init davinci_timer_init(void)
unsigned int clocksource_id;
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";
+ int i;
clockevent_id = soc_info->timer_info->clockevent_id;
clocksource_id = soc_info->timer_info->clocksource_id;
@@ -389,6 +388,9 @@ static void __init davinci_timer_init(void)
clockevent_davinci.cpumask = cpumask_of(0);
clockevents_register_device(&clockevent_davinci);
+
+ for (i=0; i< ARRAY_SIZE(timers); i++)
+ timer32_config(&timers[i]);
}
struct sys_timer davinci_timer = {