ARM: mach-shmobile: sh73a0 twd_base fix
authorMagnus Damm <damm@opensource.se>
Thu, 19 May 2011 06:26:20 +0000 (06:26 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 24 May 2011 03:31:17 +0000 (12:31 +0900)
Fix the case of too late twd_base initialization for SMP
on sh73a0 which bas been broken because sh73a0 specific
smp_prepare_cpu() and percpu_timer_setup() changed order
in the commits:

05c74a6cbcfb416286a947668ba32f63d99fe74a
c413521eb4e2d7ffd5ce432a144708d479054bd3

Without this fix the sh73a0 SMP kernel panics on boot.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/arm/mach-shmobile/smp-sh73a0.c

index a156d2108df1a9cf582340155557a7a7caf3615e..3ffdbc92ba828ddd0755ecc73648edc48539021a 100644 (file)
@@ -59,6 +59,11 @@ unsigned int __init sh73a0_get_core_count(void)
 {
        void __iomem *scu_base = scu_base_addr();
 
+#ifdef CONFIG_HAVE_ARM_TWD
+       /* twd_base needs to be initialized before percpu_timer_setup() */
+       twd_base = (void __iomem *)0xf0000600;
+#endif
+
        return scu_get_core_count(scu_base);
 }
 
@@ -82,10 +87,6 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
 
 void __init sh73a0_smp_prepare_cpus(void)
 {
-#ifdef CONFIG_HAVE_ARM_TWD
-       twd_base = (void __iomem *)0xf0000600;
-#endif
-
        scu_enable(scu_base_addr());
 
        /* Map the reset vector (in headsmp.S) */