diff options
author | Paul Walmsley <paul@pwsan.com> | 2011-01-15 23:32:01 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-01-18 14:04:12 -0500 |
commit | d8328f3b85f34c0dc5866f10bf6e7842fb511d62 (patch) | |
tree | cce2477423a170a77d0ca7364fb0f2329038220c /arch/arm/mach-omap2/timer-gp.c | |
parent | e78bf5e6cbe837daa6ab628a5f679548742994d3 (diff) |
OMAP: counter_32k: init clocksource as part of machine timer init
After commit dc548fbbd2ecd0fc3b02301d551e5f8e19ae58fd ("ARM: omap: convert
sched_clock() to use new infrastructure"), OMAPs that use the 32KiHz
"synchronization timer" as their clocksource crash during boot:
[ 0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
[ 0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 0.000000] pgd = c0004000
[ 0.000000] [00000000] *pgd=00000000
[ 0.000000] Internal error: Oops: 80000005 [#1] SMP
[ 0.000000] last sysfs file:
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 Tainted: G W (2.6.37-07734-g2467802 #7)
[ 0.000000] PC is at 0x0
[ 0.000000] LR is at sched_clock_poll+0x2c/0x3c
[ 0.000000] pc : [<00000000>] lr : [<c0060b74>] psr: 600001d3
[ 0.000000] sp : c058bfd0 ip : c058a000 fp : 00000000
[ 0.000000] r10: 00000000 r9 : 411fc092 r8 : 800330c8
[ 0.000000] r7 : c05a08e0 r6 : c0034c48 r5 : c05ffc40 r4 : c0034c4c
[ 0.000000] r3 : c05ffe6c r2 : c05a0bc0 r1 : c059f098 r0 : 00000000
[ 0.000000] Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel
[ 0.000000] Control: 10c53c7f Table: 8000404a DAC: 00000017
This is due to the recent ARM init_sched_clock() changes and the late
initialization of the counter_32k clock source. More information here:
http://marc.info/?l=linux-omap&m=129513468605208&w=2
Fix by initializing the counter_32k clocksource during the machine timer
initialization.
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/timer-gp.c')
-rw-r--r-- | arch/arm/mach-omap2/timer-gp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 4e48e786bec7..7b7c2683ae7b 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -42,6 +42,8 @@ | |||
42 | 42 | ||
43 | #include "timer-gp.h" | 43 | #include "timer-gp.h" |
44 | 44 | ||
45 | #include <plat/common.h> | ||
46 | |||
45 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ | 47 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ |
46 | #define MAX_GPTIMER_ID 12 | 48 | #define MAX_GPTIMER_ID 12 |
47 | 49 | ||
@@ -176,10 +178,14 @@ static void __init omap2_gp_clockevent_init(void) | |||
176 | /* | 178 | /* |
177 | * When 32k-timer is enabled, don't use GPTimer for clocksource | 179 | * When 32k-timer is enabled, don't use GPTimer for clocksource |
178 | * instead, just leave default clocksource which uses the 32k | 180 | * instead, just leave default clocksource which uses the 32k |
179 | * sync counter. See clocksource setup in see plat-omap/common.c. | 181 | * sync counter. See clocksource setup in plat-omap/counter_32k.c |
180 | */ | 182 | */ |
181 | 183 | ||
182 | static inline void __init omap2_gp_clocksource_init(void) {} | 184 | static void __init omap2_gp_clocksource_init(void) |
185 | { | ||
186 | omap_init_clocksource_32k(); | ||
187 | } | ||
188 | |||
183 | #else | 189 | #else |
184 | /* | 190 | /* |
185 | * clocksource | 191 | * clocksource |