diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2008-04-08 17:43:57 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-06-05 13:13:14 -0400 |
commit | b32bb803fb52cc669762780d44b4c3d9e3d799f6 (patch) | |
tree | 819b62fa4c1d884033efe7e145f46c17aa50ce76 /arch/mips/sgi-ip27 | |
parent | 2bf8ec2d8137e66998435ddf6d4060a558e2f727 (diff) |
[MIPS] IP27: Fix clockevent setup
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>
Diffstat (limited to 'arch/mips/sgi-ip27')
-rw-r--r-- | arch/mips/sgi-ip27/ip27-smp.c | 5 | ||||
-rw-r--r-- | arch/mips/sgi-ip27/ip27-timer.c | 27 |
2 files changed, 17 insertions, 15 deletions
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index f15fc93d6b35..ba5cdebeaf0d 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -176,11 +176,14 @@ static void ip27_send_ipi_mask(cpumask_t mask, unsigned int action) | |||
176 | static void __cpuinit ip27_init_secondary(void) | 176 | static void __cpuinit ip27_init_secondary(void) |
177 | { | 177 | { |
178 | per_cpu_init(); | 178 | per_cpu_init(); |
179 | local_irq_enable(); | ||
180 | } | 179 | } |
181 | 180 | ||
182 | static void __cpuinit ip27_smp_finish(void) | 181 | static void __cpuinit ip27_smp_finish(void) |
183 | { | 182 | { |
183 | extern void hub_rt_clock_event_init(void); | ||
184 | |||
185 | hub_rt_clock_event_init(); | ||
186 | local_irq_enable(); | ||
184 | } | 187 | } |
185 | 188 | ||
186 | static void __init ip27_cpus_done(void) | 189 | static void __init ip27_cpus_done(void) |
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 9cebc9e7da63..8b4e854af925 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c | |||
@@ -160,10 +160,13 @@ static void rt_set_mode(enum clock_event_mode mode, | |||
160 | 160 | ||
161 | int rt_timer_irq; | 161 | int rt_timer_irq; |
162 | 162 | ||
163 | static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent); | ||
164 | static DEFINE_PER_CPU(char [11], hub_rt_name); | ||
165 | |||
163 | static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id) | 166 | static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id) |
164 | { | 167 | { |
165 | struct clock_event_device *cd = dev_id; | ||
166 | unsigned int cpu = smp_processor_id(); | 168 | unsigned int cpu = smp_processor_id(); |
169 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); | ||
167 | int slice = cputoslice(cpu); | 170 | int slice = cputoslice(cpu); |
168 | 171 | ||
169 | /* | 172 | /* |
@@ -192,10 +195,7 @@ struct irqaction hub_rt_irqaction = { | |||
192 | #define NSEC_PER_CYCLE 800 | 195 | #define NSEC_PER_CYCLE 800 |
193 | #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE) | 196 | #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE) |
194 | 197 | ||
195 | static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent); | 198 | void __cpuinit hub_rt_clock_event_init(void) |
196 | static DEFINE_PER_CPU(char [11], hub_rt_name); | ||
197 | |||
198 | static void __cpuinit hub_rt_clock_event_init(void) | ||
199 | { | 199 | { |
200 | unsigned int cpu = smp_processor_id(); | 200 | unsigned int cpu = smp_processor_id(); |
201 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); | 201 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); |
@@ -203,17 +203,16 @@ static void __cpuinit hub_rt_clock_event_init(void) | |||
203 | int irq = rt_timer_irq; | 203 | int irq = rt_timer_irq; |
204 | 204 | ||
205 | sprintf(name, "hub-rt %d", cpu); | 205 | sprintf(name, "hub-rt %d", cpu); |
206 | cd->name = "HUB-RT", | 206 | cd->name = name; |
207 | cd->features = CLOCK_EVT_FEAT_ONESHOT, | 207 | cd->features = CLOCK_EVT_FEAT_ONESHOT; |
208 | clockevent_set_clock(cd, CYCLES_PER_SEC); | 208 | clockevent_set_clock(cd, CYCLES_PER_SEC); |
209 | cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd); | 209 | cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd); |
210 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); | 210 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); |
211 | cd->rating = 200, | 211 | cd->rating = 200; |
212 | cd->irq = irq, | 212 | cd->irq = irq; |
213 | cd->cpumask = cpumask_of_cpu(cpu), | 213 | cd->cpumask = cpumask_of_cpu(cpu); |
214 | cd->rating = 300, | 214 | cd->set_next_event = rt_next_event; |
215 | cd->set_next_event = rt_next_event, | 215 | cd->set_mode = rt_set_mode; |
216 | cd->set_mode = rt_set_mode, | ||
217 | clockevents_register_device(cd); | 216 | clockevents_register_device(cd); |
218 | } | 217 | } |
219 | 218 | ||
@@ -261,6 +260,7 @@ void __init plat_time_init(void) | |||
261 | { | 260 | { |
262 | hub_rt_clocksource_init(); | 261 | hub_rt_clocksource_init(); |
263 | hub_rt_clock_event_global_init(); | 262 | hub_rt_clock_event_global_init(); |
263 | hub_rt_clock_event_init(); | ||
264 | } | 264 | } |
265 | 265 | ||
266 | void __cpuinit cpu_time_init(void) | 266 | void __cpuinit cpu_time_init(void) |
@@ -281,7 +281,6 @@ void __cpuinit cpu_time_init(void) | |||
281 | 281 | ||
282 | printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); | 282 | printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); |
283 | 283 | ||
284 | hub_rt_clock_event_init(); | ||
285 | set_c0_status(SRB_TIMOCLK); | 284 | set_c0_status(SRB_TIMOCLK); |
286 | } | 285 | } |
287 | 286 | ||