]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: 6759/1: smp: Select local timers vs broadcast timer support runtime
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Wed, 23 Feb 2011 17:53:15 +0000 (18:53 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 23 Feb 2011 17:54:27 +0000 (17:54 +0000)
The current code support of dummy timers in absence of local
timer is compile time. This is an attempt to convert it to runtime
so that on few SOC version if the local timers aren't supported
kernel can switch to dummy timers. OMAP4430 ES1.0 does suffer from
this limitation.

This patch should not have any functional impact on affected
files.

Cc: Daniel Walker <dwalker@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/localtimer.h
arch/arm/kernel/smp.c
arch/arm/mach-msm/timer.c
arch/arm/mach-omap2/timer-mpu.c
arch/arm/mach-s5pv310/localtimer.c
arch/arm/mach-shmobile/localtimer.c
arch/arm/mach-tegra/localtimer.c
arch/arm/mach-ux500/localtimer.c
arch/arm/plat-versatile/localtimer.c

index 6bc63ab498ce45d3c343a4b51f4b26790c8640ee..080d74f8128d4a4a5feb10b579aa42f5d757439f 100644 (file)
@@ -44,8 +44,14 @@ int local_timer_ack(void);
 /*
  * Setup a local timer interrupt for a CPU.
  */
-void local_timer_setup(struct clock_event_device *);
+int local_timer_setup(struct clock_event_device *);
 
+#else
+
+static inline int local_timer_setup(struct clock_event_device *evt)
+{
+       return -ENXIO;
+}
 #endif
 
 #endif
index 4539ebcb089fad0c9471310aed633da450cf963f..8fe05ad932e4bd0b113c11c19f7e816650ace696 100644 (file)
@@ -474,13 +474,12 @@ static void smp_timer_broadcast(const struct cpumask *mask)
 #define smp_timer_broadcast    NULL
 #endif
 
-#ifndef CONFIG_LOCAL_TIMERS
 static void broadcast_timer_set_mode(enum clock_event_mode mode,
        struct clock_event_device *evt)
 {
 }
 
-static void local_timer_setup(struct clock_event_device *evt)
+static void broadcast_timer_setup(struct clock_event_device *evt)
 {
        evt->name       = "dummy_timer";
        evt->features   = CLOCK_EVT_FEAT_ONESHOT |
@@ -492,7 +491,6 @@ static void local_timer_setup(struct clock_event_device *evt)
 
        clockevents_register_device(evt);
 }
-#endif
 
 void __cpuinit percpu_timer_setup(void)
 {
@@ -502,7 +500,8 @@ void __cpuinit percpu_timer_setup(void)
        evt->cpumask = cpumask_of(cpu);
        evt->broadcast = smp_timer_broadcast;
 
-       local_timer_setup(evt);
+       if (local_timer_setup(evt))
+               broadcast_timer_setup(evt);
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
index c105d28b53e38bc5f6ec331c35343aefe9581ac1..ae85aa951806a46279d8c9cfb9fc2a2a977f843d 100644 (file)
@@ -255,7 +255,7 @@ static void __init msm_timer_init(void)
 }
 
 #ifdef CONFIG_SMP
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
 
@@ -287,6 +287,7 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt)
        gic_enable_ppi(clock->irq.irq);
 
        clockevents_register_device(evt);
+       return 0;
 }
 
 inline int local_timer_ack(void)
index 954682e6439966c3e9dc834290fdeb72875b1104..09c73dcfc2ac0fb0f5829a793f8eb47fe014fdbd 100644 (file)
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = OMAP44XX_IRQ_LOCALTIMER;
        twd_timer_setup(evt);
+       return 0;
 }
 
index 2784036cd8b10a7fcd0360adbbdd2afc0b2adc34..8239c6a684a1c36286f422b5a9a5ef723b5594b6 100644 (file)
@@ -18,8 +18,9 @@
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = IRQ_LOCALTIMER;
        twd_timer_setup(evt);
+       return 0;
 }
index 2111c28b724e24580a4a19a08649787aa9385344..ad9ccc9900c825bf874b94ebd9fc4e2cb84576d2 100644 (file)
@@ -18,8 +18,9 @@
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = 29;
        twd_timer_setup(evt);
+       return 0;
 }
index f81ca7cbbc1f7279aea08174896aec401725fa54..e91d681d45a2d8593a49e3bf3406a173b2a250c2 100644 (file)
@@ -18,8 +18,9 @@
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = IRQ_LOCALTIMER;
        twd_timer_setup(evt);
+       return 0;
 }
index 2288f6a7c5180c8920f0e0e9a04ea95217241489..5ba113309a0b3c451e1d3dcbb50010a171a94b1d 100644 (file)
@@ -21,8 +21,9 @@
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = IRQ_LOCALTIMER;
        twd_timer_setup(evt);
+       return 0;
 }
index 83ebee569333c9439061903d34937788649b37f2..0fb3961999b51861c352fae14635cfa9f8e6c422 100644 (file)
@@ -19,8 +19,9 @@
 /*
  * Setup the local clock events for a CPU.
  */
-void __cpuinit local_timer_setup(struct clock_event_device *evt)
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        evt->irq = IRQ_LOCALTIMER;
        twd_timer_setup(evt);
+       return 0;
 }