[MIPS] IP27: Fix clockevent setup
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 8 Apr 2008 21:43:57 +0000 (23:43 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 5 Jun 2008 17:13:14 +0000 (18:13 +0100)
Fix breakage introduced by converting hub_rt to clockevent.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/sgi-ip27/ip27-smp.c
arch/mips/sgi-ip27/ip27-timer.c

index f15fc93d6b35112331fbd0fd9c842c0cf36bcb86..ba5cdebeaf0d23d703ce93a163cdd1b030a6bdf6 100644 (file)
@@ -176,11 +176,14 @@ static void ip27_send_ipi_mask(cpumask_t mask, unsigned int action)
 static void __cpuinit ip27_init_secondary(void)
 {
        per_cpu_init();
-       local_irq_enable();
 }
 
 static void __cpuinit ip27_smp_finish(void)
 {
+       extern void hub_rt_clock_event_init(void);
+
+       hub_rt_clock_event_init();
+       local_irq_enable();
 }
 
 static void __init ip27_cpus_done(void)
index 9cebc9e7da63ad4c926fbd142f39da54313d8594..8b4e854af925b4b832dff234c0a0bcd64e2f5a42 100644 (file)
@@ -160,10 +160,13 @@ static void rt_set_mode(enum clock_event_mode mode,
 
 int rt_timer_irq;
 
+static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
+static DEFINE_PER_CPU(char [11], hub_rt_name);
+
 static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 {
-       struct clock_event_device *cd = dev_id;
        unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
        int slice = cputoslice(cpu);
 
        /*
@@ -192,10 +195,7 @@ struct irqaction hub_rt_irqaction = {
 #define NSEC_PER_CYCLE         800
 #define CYCLES_PER_SEC         (NSEC_PER_SEC / NSEC_PER_CYCLE)
 
-static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
-static DEFINE_PER_CPU(char [11], hub_rt_name);
-
-static void __cpuinit hub_rt_clock_event_init(void)
+void __cpuinit hub_rt_clock_event_init(void)
 {
        unsigned int cpu = smp_processor_id();
        struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
@@ -203,17 +203,16 @@ static void __cpuinit hub_rt_clock_event_init(void)
        int irq = rt_timer_irq;
 
        sprintf(name, "hub-rt %d", cpu);
-       cd->name                = "HUB-RT",
-       cd->features            = CLOCK_EVT_FEAT_ONESHOT,
+       cd->name                = name;
+       cd->features            = CLOCK_EVT_FEAT_ONESHOT;
        clockevent_set_clock(cd, CYCLES_PER_SEC);
        cd->max_delta_ns        = clockevent_delta2ns(0xfffffffffffff, cd);
        cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
-       cd->rating              = 200,
-       cd->irq                 = irq,
-       cd->cpumask             = cpumask_of_cpu(cpu),
-       cd->rating              = 300,
-       cd->set_next_event      = rt_next_event,
-       cd->set_mode            = rt_set_mode,
+       cd->rating              = 200;
+       cd->irq                 = irq;
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       cd->set_next_event      = rt_next_event;
+       cd->set_mode            = rt_set_mode;
        clockevents_register_device(cd);
 }
 
@@ -261,6 +260,7 @@ void __init plat_time_init(void)
 {
        hub_rt_clocksource_init();
        hub_rt_clock_event_global_init();
+       hub_rt_clock_event_init();
 }
 
 void __cpuinit cpu_time_init(void)
@@ -281,7 +281,6 @@ void __cpuinit cpu_time_init(void)
 
        printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed);
 
-       hub_rt_clock_event_init();
        set_c0_status(SRB_TIMOCLK);
 }