diff options
| -rw-r--r-- | arch/x86/kernel/apb_timer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c index 83a345b0256c..6f27f8b75795 100644 --- a/arch/x86/kernel/apb_timer.c +++ b/arch/x86/kernel/apb_timer.c | |||
| @@ -84,9 +84,10 @@ struct apbt_dev { | |||
| 84 | 84 | ||
| 85 | int disable_apbt_percpu __cpuinitdata; | 85 | int disable_apbt_percpu __cpuinitdata; |
| 86 | 86 | ||
| 87 | static DEFINE_PER_CPU(struct apbt_dev, cpu_apbt_dev); | ||
| 88 | |||
| 87 | #ifdef CONFIG_SMP | 89 | #ifdef CONFIG_SMP |
| 88 | static unsigned int apbt_num_timers_used; | 90 | static unsigned int apbt_num_timers_used; |
| 89 | static DEFINE_PER_CPU(struct apbt_dev, cpu_apbt_dev); | ||
| 90 | static struct apbt_dev *apbt_devs; | 91 | static struct apbt_dev *apbt_devs; |
| 91 | #endif | 92 | #endif |
| 92 | 93 | ||
| @@ -302,6 +303,7 @@ static void apbt_disable_int(int n) | |||
| 302 | static int __init apbt_clockevent_register(void) | 303 | static int __init apbt_clockevent_register(void) |
| 303 | { | 304 | { |
| 304 | struct sfi_timer_table_entry *mtmr; | 305 | struct sfi_timer_table_entry *mtmr; |
| 306 | struct apbt_dev *adev = &__get_cpu_var(cpu_apbt_dev); | ||
| 305 | 307 | ||
| 306 | mtmr = sfi_get_mtmr(APBT_CLOCKEVENT0_NUM); | 308 | mtmr = sfi_get_mtmr(APBT_CLOCKEVENT0_NUM); |
| 307 | if (mtmr == NULL) { | 309 | if (mtmr == NULL) { |
| @@ -329,22 +331,24 @@ static int __init apbt_clockevent_register(void) | |||
| 329 | * global if not used for per cpu timer. | 331 | * global if not used for per cpu timer. |
| 330 | */ | 332 | */ |
| 331 | apbt_clockevent.cpumask = cpumask_of(smp_processor_id()); | 333 | apbt_clockevent.cpumask = cpumask_of(smp_processor_id()); |
| 334 | adev->num = smp_processor_id(); | ||
| 335 | memcpy(&adev->evt, &apbt_clockevent, sizeof(struct clock_event_device)); | ||
| 332 | 336 | ||
| 333 | if (disable_apbt_percpu) { | 337 | if (disable_apbt_percpu) { |
| 334 | apbt_clockevent.rating = APBT_CLOCKEVENT_RATING - 100; | 338 | apbt_clockevent.rating = APBT_CLOCKEVENT_RATING - 100; |
| 335 | global_clock_event = &apbt_clockevent; | 339 | global_clock_event = &adev->evt; |
| 336 | printk(KERN_DEBUG "%s clockevent registered as global\n", | 340 | printk(KERN_DEBUG "%s clockevent registered as global\n", |
| 337 | global_clock_event->name); | 341 | global_clock_event->name); |
| 338 | } | 342 | } |
| 339 | 343 | ||
| 340 | if (request_irq(apbt_clockevent.irq, apbt_interrupt_handler, | 344 | if (request_irq(apbt_clockevent.irq, apbt_interrupt_handler, |
| 341 | IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING, | 345 | IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING, |
| 342 | apbt_clockevent.name, &apbt_clockevent)) { | 346 | apbt_clockevent.name, adev)) { |
| 343 | printk(KERN_ERR "Failed request IRQ for APBT%d\n", | 347 | printk(KERN_ERR "Failed request IRQ for APBT%d\n", |
| 344 | apbt_clockevent.irq); | 348 | apbt_clockevent.irq); |
| 345 | } | 349 | } |
| 346 | 350 | ||
| 347 | clockevents_register_device(&apbt_clockevent); | 351 | clockevents_register_device(&adev->evt); |
| 348 | /* Start APBT 0 interrupts */ | 352 | /* Start APBT 0 interrupts */ |
| 349 | apbt_enable_int(APBT_CLOCKEVENT0_NUM); | 353 | apbt_enable_int(APBT_CLOCKEVENT0_NUM); |
| 350 | 354 | ||
