diff options
| -rw-r--r-- | arch/x86/include/asm/entry_arch.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/hardirq.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/hw_irq.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/irq.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/irq_vectors.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/entry_64.S | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/irq.c | 20 | ||||
| -rw-r--r-- | arch/x86/kernel/irqinit.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/uv_time.c | 80 |
9 files changed, 69 insertions, 51 deletions
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h index f5693c81a1db..8e8ec663a98f 100644 --- a/arch/x86/include/asm/entry_arch.h +++ b/arch/x86/include/asm/entry_arch.h | |||
| @@ -34,7 +34,7 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7, | |||
| 34 | smp_invalidate_interrupt) | 34 | smp_invalidate_interrupt) |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR) | 37 | BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR) |
| 38 | 38 | ||
| 39 | /* | 39 | /* |
| 40 | * every pentium local APIC has two 'local interrupts', with a | 40 | * every pentium local APIC has two 'local interrupts', with a |
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 108eb6fd1ae7..0f8576427cfe 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
| @@ -12,7 +12,7 @@ typedef struct { | |||
| 12 | unsigned int apic_timer_irqs; /* arch dependent */ | 12 | unsigned int apic_timer_irqs; /* arch dependent */ |
| 13 | unsigned int irq_spurious_count; | 13 | unsigned int irq_spurious_count; |
| 14 | #endif | 14 | #endif |
| 15 | unsigned int generic_irqs; /* arch dependent */ | 15 | unsigned int x86_platform_ipis; /* arch dependent */ |
| 16 | unsigned int apic_perf_irqs; | 16 | unsigned int apic_perf_irqs; |
| 17 | unsigned int apic_pending_irqs; | 17 | unsigned int apic_pending_irqs; |
| 18 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 6e124269fd4b..08c48a81841f 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | /* Interrupt handlers registered during init_IRQ */ | 28 | /* Interrupt handlers registered during init_IRQ */ |
| 29 | extern void apic_timer_interrupt(void); | 29 | extern void apic_timer_interrupt(void); |
| 30 | extern void generic_interrupt(void); | 30 | extern void x86_platform_ipi(void); |
| 31 | extern void error_interrupt(void); | 31 | extern void error_interrupt(void); |
| 32 | extern void perf_pending_interrupt(void); | 32 | extern void perf_pending_interrupt(void); |
| 33 | 33 | ||
| @@ -119,7 +119,7 @@ extern void eisa_set_level_irq(unsigned int irq); | |||
| 119 | /* SMP */ | 119 | /* SMP */ |
| 120 | extern void smp_apic_timer_interrupt(struct pt_regs *); | 120 | extern void smp_apic_timer_interrupt(struct pt_regs *); |
| 121 | extern void smp_spurious_interrupt(struct pt_regs *); | 121 | extern void smp_spurious_interrupt(struct pt_regs *); |
| 122 | extern void smp_generic_interrupt(struct pt_regs *); | 122 | extern void smp_x86_platform_ipi(struct pt_regs *); |
| 123 | extern void smp_error_interrupt(struct pt_regs *); | 123 | extern void smp_error_interrupt(struct pt_regs *); |
| 124 | #ifdef CONFIG_X86_IO_APIC | 124 | #ifdef CONFIG_X86_IO_APIC |
| 125 | extern asmlinkage void smp_irq_move_cleanup_interrupt(void); | 125 | extern asmlinkage void smp_irq_move_cleanup_interrupt(void); |
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index ffd700ff5dcb..5458380b6ef8 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h | |||
| @@ -37,7 +37,7 @@ extern void fixup_irqs(void); | |||
| 37 | extern void irq_force_complete_move(int); | 37 | extern void irq_force_complete_move(int); |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | extern void (*generic_interrupt_extension)(void); | 40 | extern void (*x86_platform_ipi_callback)(void); |
| 41 | extern void native_init_IRQ(void); | 41 | extern void native_init_IRQ(void); |
| 42 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); | 42 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); |
| 43 | 43 | ||
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 5b21f0ec3df2..6a635bd39867 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
| @@ -106,7 +106,7 @@ | |||
| 106 | /* | 106 | /* |
| 107 | * Generic system vector for platform specific use | 107 | * Generic system vector for platform specific use |
| 108 | */ | 108 | */ |
| 109 | #define GENERIC_INTERRUPT_VECTOR 0xed | 109 | #define X86_PLATFORM_IPI_VECTOR 0xed |
| 110 | 110 | ||
| 111 | /* | 111 | /* |
| 112 | * Performance monitoring pending work vector: | 112 | * Performance monitoring pending work vector: |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 4deb8fc849dd..63bca794c8f9 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -977,8 +977,8 @@ apicinterrupt UV_BAU_MESSAGE \ | |||
| 977 | #endif | 977 | #endif |
| 978 | apicinterrupt LOCAL_TIMER_VECTOR \ | 978 | apicinterrupt LOCAL_TIMER_VECTOR \ |
| 979 | apic_timer_interrupt smp_apic_timer_interrupt | 979 | apic_timer_interrupt smp_apic_timer_interrupt |
| 980 | apicinterrupt GENERIC_INTERRUPT_VECTOR \ | 980 | apicinterrupt X86_PLATFORM_IPI_VECTOR \ |
| 981 | generic_interrupt smp_generic_interrupt | 981 | x86_platform_ipi smp_x86_platform_ipi |
| 982 | 982 | ||
| 983 | #ifdef CONFIG_SMP | 983 | #ifdef CONFIG_SMP |
| 984 | apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \ | 984 | apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \ |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index fee6cc2b2079..664bcb7384ac 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | atomic_t irq_err_count; | 18 | atomic_t irq_err_count; |
| 19 | 19 | ||
| 20 | /* Function pointer for generic interrupt vector handling */ | 20 | /* Function pointer for generic interrupt vector handling */ |
| 21 | void (*generic_interrupt_extension)(void) = NULL; | 21 | void (*x86_platform_ipi_callback)(void) = NULL; |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * 'what should we do if we get a hw irq event on an illegal vector'. | 24 | * 'what should we do if we get a hw irq event on an illegal vector'. |
| @@ -72,10 +72,10 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
| 72 | seq_printf(p, "%10u ", irq_stats(j)->apic_pending_irqs); | 72 | seq_printf(p, "%10u ", irq_stats(j)->apic_pending_irqs); |
| 73 | seq_printf(p, " Performance pending work\n"); | 73 | seq_printf(p, " Performance pending work\n"); |
| 74 | #endif | 74 | #endif |
| 75 | if (generic_interrupt_extension) { | 75 | if (x86_platform_ipi_callback) { |
| 76 | seq_printf(p, "%*s: ", prec, "PLT"); | 76 | seq_printf(p, "%*s: ", prec, "PLT"); |
| 77 | for_each_online_cpu(j) | 77 | for_each_online_cpu(j) |
| 78 | seq_printf(p, "%10u ", irq_stats(j)->generic_irqs); | 78 | seq_printf(p, "%10u ", irq_stats(j)->x86_platform_ipis); |
| 79 | seq_printf(p, " Platform interrupts\n"); | 79 | seq_printf(p, " Platform interrupts\n"); |
| 80 | } | 80 | } |
| 81 | #ifdef CONFIG_SMP | 81 | #ifdef CONFIG_SMP |
| @@ -187,8 +187,8 @@ u64 arch_irq_stat_cpu(unsigned int cpu) | |||
| 187 | sum += irq_stats(cpu)->apic_perf_irqs; | 187 | sum += irq_stats(cpu)->apic_perf_irqs; |
| 188 | sum += irq_stats(cpu)->apic_pending_irqs; | 188 | sum += irq_stats(cpu)->apic_pending_irqs; |
| 189 | #endif | 189 | #endif |
| 190 | if (generic_interrupt_extension) | 190 | if (x86_platform_ipi_callback) |
| 191 | sum += irq_stats(cpu)->generic_irqs; | 191 | sum += irq_stats(cpu)->x86_platform_ipis; |
| 192 | #ifdef CONFIG_SMP | 192 | #ifdef CONFIG_SMP |
| 193 | sum += irq_stats(cpu)->irq_resched_count; | 193 | sum += irq_stats(cpu)->irq_resched_count; |
| 194 | sum += irq_stats(cpu)->irq_call_count; | 194 | sum += irq_stats(cpu)->irq_call_count; |
| @@ -251,9 +251,9 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs) | |||
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | /* | 253 | /* |
| 254 | * Handler for GENERIC_INTERRUPT_VECTOR. | 254 | * Handler for X86_PLATFORM_IPI_VECTOR. |
| 255 | */ | 255 | */ |
| 256 | void smp_generic_interrupt(struct pt_regs *regs) | 256 | void smp_x86_platform_ipi(struct pt_regs *regs) |
| 257 | { | 257 | { |
| 258 | struct pt_regs *old_regs = set_irq_regs(regs); | 258 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 259 | 259 | ||
| @@ -263,10 +263,10 @@ void smp_generic_interrupt(struct pt_regs *regs) | |||
| 263 | 263 | ||
| 264 | irq_enter(); | 264 | irq_enter(); |
| 265 | 265 | ||
| 266 | inc_irq_stat(generic_irqs); | 266 | inc_irq_stat(x86_platform_ipis); |
| 267 | 267 | ||
| 268 | if (generic_interrupt_extension) | 268 | if (x86_platform_ipi_callback) |
| 269 | generic_interrupt_extension(); | 269 | x86_platform_ipi_callback(); |
| 270 | 270 | ||
| 271 | irq_exit(); | 271 | irq_exit(); |
| 272 | 272 | ||
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 40f30773fb29..d5932226614f 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
| @@ -200,8 +200,8 @@ static void __init apic_intr_init(void) | |||
| 200 | /* self generated IPI for local APIC timer */ | 200 | /* self generated IPI for local APIC timer */ |
| 201 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); | 201 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); |
| 202 | 202 | ||
| 203 | /* generic IPI for platform specific use */ | 203 | /* IPI for X86 platform specific use */ |
| 204 | alloc_intr_gate(GENERIC_INTERRUPT_VECTOR, generic_interrupt); | 204 | alloc_intr_gate(X86_PLATFORM_IPI_VECTOR, x86_platform_ipi); |
| 205 | 205 | ||
| 206 | /* IPI vectors for APIC spurious and error interrupts */ | 206 | /* IPI vectors for APIC spurious and error interrupts */ |
| 207 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); | 207 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); |
diff --git a/arch/x86/kernel/uv_time.c b/arch/x86/kernel/uv_time.c index 583f11d5c480..3c84aa001c11 100644 --- a/arch/x86/kernel/uv_time.c +++ b/arch/x86/kernel/uv_time.c | |||
| @@ -74,7 +74,7 @@ struct uv_rtc_timer_head { | |||
| 74 | */ | 74 | */ |
| 75 | static struct uv_rtc_timer_head **blade_info __read_mostly; | 75 | static struct uv_rtc_timer_head **blade_info __read_mostly; |
| 76 | 76 | ||
| 77 | static int uv_rtc_enable; | 77 | static int uv_rtc_evt_enable; |
| 78 | 78 | ||
| 79 | /* | 79 | /* |
| 80 | * Hardware interface routines | 80 | * Hardware interface routines |
| @@ -90,7 +90,7 @@ static void uv_rtc_send_IPI(int cpu) | |||
| 90 | pnode = uv_apicid_to_pnode(apicid); | 90 | pnode = uv_apicid_to_pnode(apicid); |
| 91 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 91 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
| 92 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 92 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
| 93 | (GENERIC_INTERRUPT_VECTOR << UVH_IPI_INT_VECTOR_SHFT); | 93 | (X86_PLATFORM_IPI_VECTOR << UVH_IPI_INT_VECTOR_SHFT); |
| 94 | 94 | ||
| 95 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 95 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
| 96 | } | 96 | } |
| @@ -115,7 +115,7 @@ static int uv_setup_intr(int cpu, u64 expires) | |||
| 115 | uv_write_global_mmr64(pnode, UVH_EVENT_OCCURRED0_ALIAS, | 115 | uv_write_global_mmr64(pnode, UVH_EVENT_OCCURRED0_ALIAS, |
| 116 | UVH_EVENT_OCCURRED0_RTC1_MASK); | 116 | UVH_EVENT_OCCURRED0_RTC1_MASK); |
| 117 | 117 | ||
| 118 | val = (GENERIC_INTERRUPT_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) | | 118 | val = (X86_PLATFORM_IPI_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) | |
| 119 | ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT); | 119 | ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT); |
| 120 | 120 | ||
| 121 | /* Set configuration */ | 121 | /* Set configuration */ |
| @@ -123,7 +123,10 @@ static int uv_setup_intr(int cpu, u64 expires) | |||
| 123 | /* Initialize comparator value */ | 123 | /* Initialize comparator value */ |
| 124 | uv_write_global_mmr64(pnode, UVH_INT_CMPB, expires); | 124 | uv_write_global_mmr64(pnode, UVH_INT_CMPB, expires); |
| 125 | 125 | ||
| 126 | return (expires < uv_read_rtc(NULL) && !uv_intr_pending(pnode)); | 126 | if (uv_read_rtc(NULL) <= expires) |
| 127 | return 0; | ||
| 128 | |||
| 129 | return !uv_intr_pending(pnode); | ||
| 127 | } | 130 | } |
| 128 | 131 | ||
| 129 | /* | 132 | /* |
| @@ -223,6 +226,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires) | |||
| 223 | 226 | ||
| 224 | next_cpu = head->next_cpu; | 227 | next_cpu = head->next_cpu; |
| 225 | *t = expires; | 228 | *t = expires; |
| 229 | |||
| 226 | /* Will this one be next to go off? */ | 230 | /* Will this one be next to go off? */ |
| 227 | if (next_cpu < 0 || bcpu == next_cpu || | 231 | if (next_cpu < 0 || bcpu == next_cpu || |
| 228 | expires < head->cpu[next_cpu].expires) { | 232 | expires < head->cpu[next_cpu].expires) { |
| @@ -231,7 +235,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires) | |||
| 231 | *t = ULLONG_MAX; | 235 | *t = ULLONG_MAX; |
| 232 | uv_rtc_find_next_timer(head, pnode); | 236 | uv_rtc_find_next_timer(head, pnode); |
| 233 | spin_unlock_irqrestore(&head->lock, flags); | 237 | spin_unlock_irqrestore(&head->lock, flags); |
| 234 | return 1; | 238 | return -ETIME; |
| 235 | } | 239 | } |
| 236 | } | 240 | } |
| 237 | 241 | ||
| @@ -244,7 +248,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires) | |||
| 244 | * | 248 | * |
| 245 | * Returns 1 if this timer was pending. | 249 | * Returns 1 if this timer was pending. |
| 246 | */ | 250 | */ |
| 247 | static int uv_rtc_unset_timer(int cpu) | 251 | static int uv_rtc_unset_timer(int cpu, int force) |
| 248 | { | 252 | { |
| 249 | int pnode = uv_cpu_to_pnode(cpu); | 253 | int pnode = uv_cpu_to_pnode(cpu); |
| 250 | int bid = uv_cpu_to_blade_id(cpu); | 254 | int bid = uv_cpu_to_blade_id(cpu); |
| @@ -256,14 +260,15 @@ static int uv_rtc_unset_timer(int cpu) | |||
| 256 | 260 | ||
| 257 | spin_lock_irqsave(&head->lock, flags); | 261 | spin_lock_irqsave(&head->lock, flags); |
| 258 | 262 | ||
| 259 | if (head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) | 263 | if ((head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) || force) |
| 260 | rc = 1; | 264 | rc = 1; |
| 261 | 265 | ||
| 262 | *t = ULLONG_MAX; | 266 | if (rc) { |
| 263 | 267 | *t = ULLONG_MAX; | |
| 264 | /* Was the hardware setup for this timer? */ | 268 | /* Was the hardware setup for this timer? */ |
| 265 | if (head->next_cpu == bcpu) | 269 | if (head->next_cpu == bcpu) |
| 266 | uv_rtc_find_next_timer(head, pnode); | 270 | uv_rtc_find_next_timer(head, pnode); |
| 271 | } | ||
| 267 | 272 | ||
| 268 | spin_unlock_irqrestore(&head->lock, flags); | 273 | spin_unlock_irqrestore(&head->lock, flags); |
| 269 | 274 | ||
| @@ -310,32 +315,32 @@ static void uv_rtc_timer_setup(enum clock_event_mode mode, | |||
| 310 | break; | 315 | break; |
| 311 | case CLOCK_EVT_MODE_UNUSED: | 316 | case CLOCK_EVT_MODE_UNUSED: |
| 312 | case CLOCK_EVT_MODE_SHUTDOWN: | 317 | case CLOCK_EVT_MODE_SHUTDOWN: |
| 313 | uv_rtc_unset_timer(ced_cpu); | 318 | uv_rtc_unset_timer(ced_cpu, 1); |
| 314 | break; | 319 | break; |
| 315 | } | 320 | } |
| 316 | } | 321 | } |
| 317 | 322 | ||
| 318 | static void uv_rtc_interrupt(void) | 323 | static void uv_rtc_interrupt(void) |
| 319 | { | 324 | { |
| 320 | struct clock_event_device *ced = &__get_cpu_var(cpu_ced); | ||
| 321 | int cpu = smp_processor_id(); | 325 | int cpu = smp_processor_id(); |
| 326 | struct clock_event_device *ced = &per_cpu(cpu_ced, cpu); | ||
| 322 | 327 | ||
| 323 | if (!ced || !ced->event_handler) | 328 | if (!ced || !ced->event_handler) |
| 324 | return; | 329 | return; |
| 325 | 330 | ||
| 326 | if (uv_rtc_unset_timer(cpu) != 1) | 331 | if (uv_rtc_unset_timer(cpu, 0) != 1) |
| 327 | return; | 332 | return; |
| 328 | 333 | ||
| 329 | ced->event_handler(ced); | 334 | ced->event_handler(ced); |
| 330 | } | 335 | } |
| 331 | 336 | ||
| 332 | static int __init uv_enable_rtc(char *str) | 337 | static int __init uv_enable_evt_rtc(char *str) |
| 333 | { | 338 | { |
| 334 | uv_rtc_enable = 1; | 339 | uv_rtc_evt_enable = 1; |
| 335 | 340 | ||
| 336 | return 1; | 341 | return 1; |
| 337 | } | 342 | } |
| 338 | __setup("uvrtc", uv_enable_rtc); | 343 | __setup("uvrtcevt", uv_enable_evt_rtc); |
| 339 | 344 | ||
| 340 | static __init void uv_rtc_register_clockevents(struct work_struct *dummy) | 345 | static __init void uv_rtc_register_clockevents(struct work_struct *dummy) |
| 341 | { | 346 | { |
| @@ -350,27 +355,32 @@ static __init int uv_rtc_setup_clock(void) | |||
| 350 | { | 355 | { |
| 351 | int rc; | 356 | int rc; |
| 352 | 357 | ||
| 353 | if (!uv_rtc_enable || !is_uv_system() || generic_interrupt_extension) | 358 | if (!is_uv_system()) |
| 354 | return -ENODEV; | 359 | return -ENODEV; |
| 355 | 360 | ||
| 356 | generic_interrupt_extension = uv_rtc_interrupt; | ||
| 357 | |||
| 358 | clocksource_uv.mult = clocksource_hz2mult(sn_rtc_cycles_per_second, | 361 | clocksource_uv.mult = clocksource_hz2mult(sn_rtc_cycles_per_second, |
| 359 | clocksource_uv.shift); | 362 | clocksource_uv.shift); |
| 360 | 363 | ||
| 364 | /* If single blade, prefer tsc */ | ||
| 365 | if (uv_num_possible_blades() == 1) | ||
| 366 | clocksource_uv.rating = 250; | ||
| 367 | |||
| 361 | rc = clocksource_register(&clocksource_uv); | 368 | rc = clocksource_register(&clocksource_uv); |
| 362 | if (rc) { | 369 | if (rc) |
| 363 | generic_interrupt_extension = NULL; | 370 | printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc); |
| 371 | else | ||
| 372 | printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n", | ||
| 373 | sn_rtc_cycles_per_second/(unsigned long)1E6); | ||
| 374 | |||
| 375 | if (rc || !uv_rtc_evt_enable || x86_platform_ipi_callback) | ||
| 364 | return rc; | 376 | return rc; |
| 365 | } | ||
| 366 | 377 | ||
| 367 | /* Setup and register clockevents */ | 378 | /* Setup and register clockevents */ |
| 368 | rc = uv_rtc_allocate_timers(); | 379 | rc = uv_rtc_allocate_timers(); |
| 369 | if (rc) { | 380 | if (rc) |
| 370 | clocksource_unregister(&clocksource_uv); | 381 | goto error; |
| 371 | generic_interrupt_extension = NULL; | 382 | |
| 372 | return rc; | 383 | x86_platform_ipi_callback = uv_rtc_interrupt; |
| 373 | } | ||
| 374 | 384 | ||
| 375 | clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second, | 385 | clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second, |
| 376 | NSEC_PER_SEC, clock_event_device_uv.shift); | 386 | NSEC_PER_SEC, clock_event_device_uv.shift); |
| @@ -383,11 +393,19 @@ static __init int uv_rtc_setup_clock(void) | |||
| 383 | 393 | ||
| 384 | rc = schedule_on_each_cpu(uv_rtc_register_clockevents); | 394 | rc = schedule_on_each_cpu(uv_rtc_register_clockevents); |
| 385 | if (rc) { | 395 | if (rc) { |
| 386 | clocksource_unregister(&clocksource_uv); | 396 | x86_platform_ipi_callback = NULL; |
| 387 | generic_interrupt_extension = NULL; | ||
| 388 | uv_rtc_deallocate_timers(); | 397 | uv_rtc_deallocate_timers(); |
| 398 | goto error; | ||
| 389 | } | 399 | } |
| 390 | 400 | ||
| 401 | printk(KERN_INFO "UV RTC clockevents registered\n"); | ||
| 402 | |||
| 403 | return 0; | ||
| 404 | |||
| 405 | error: | ||
| 406 | clocksource_unregister(&clocksource_uv); | ||
| 407 | printk(KERN_INFO "UV RTC clockevents failed rc %d\n", rc); | ||
| 408 | |||
| 391 | return rc; | 409 | return rc; |
| 392 | } | 410 | } |
| 393 | arch_initcall(uv_rtc_setup_clock); | 411 | arch_initcall(uv_rtc_setup_clock); |
