[IA64] Initialize interrupts later (from init_IRQ())

Thomas Gleixner is cleaning up the generic irq code, and ia64 ran
into problems because it calls register_intr() before early_irq_init()
is called. Move the call to acpi_boot_init() from setup_arch() to
init_IRQ().

As a bonus - moving the call later means we no longer need the
hacks in iosapic.c to switch between the bootmem and regular
allocator - we can just used kzalloc() for allocation.

Signed-off-by: Tony Luck <tony.luck@intel.com>

Tony Luck 4de0a759 899611ee

+5 -51
+1 -47
arch/ia64/kernel/iosapic.c
··· 108 108 #define DBG(fmt...) 109 109 #endif 110 110 111 - #define NR_PREALLOCATE_RTE_ENTRIES \ 112 - (PAGE_SIZE / sizeof(struct iosapic_rte_info)) 113 - #define RTE_PREALLOCATED (1) 114 - 115 111 static DEFINE_SPINLOCK(iosapic_lock); 116 112 117 113 /* ··· 132 136 struct list_head rte_list; /* RTEs sharing the same vector */ 133 137 char rte_index; /* IOSAPIC RTE index */ 134 138 int refcnt; /* reference counter */ 135 - unsigned int flags; /* flags */ 136 139 struct iosapic *iosapic; 137 140 } ____cacheline_aligned; 138 141 ··· 149 154 } iosapic_intr_info[NR_IRQS]; 150 155 151 156 static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */ 152 - 153 - static int iosapic_kmalloc_ok; 154 - static LIST_HEAD(free_rte_list); 155 157 156 158 static inline void 157 159 iosapic_write(struct iosapic *iosapic, unsigned int reg, u32 val) ··· 544 552 } 545 553 } 546 554 547 - static struct iosapic_rte_info * __init_refok iosapic_alloc_rte (void) 548 - { 549 - int i; 550 - struct iosapic_rte_info *rte; 551 - int preallocated = 0; 552 - 553 - if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) { 554 - rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * 555 - NR_PREALLOCATE_RTE_ENTRIES); 556 - for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++) 557 - list_add(&rte->rte_list, &free_rte_list); 558 - } 559 - 560 - if (!list_empty(&free_rte_list)) { 561 - rte = list_entry(free_rte_list.next, struct iosapic_rte_info, 562 - rte_list); 563 - list_del(&rte->rte_list); 564 - preallocated++; 565 - } else { 566 - rte = kmalloc(sizeof(struct iosapic_rte_info), GFP_ATOMIC); 567 - if (!rte) 568 - return NULL; 569 - } 570 - 571 - memset(rte, 0, sizeof(struct iosapic_rte_info)); 572 - if (preallocated) 573 - rte->flags |= RTE_PREALLOCATED; 574 - 575 - return rte; 576 - } 577 - 578 555 static inline int irq_is_shared (int irq) 579 556 { 580 557 return (iosapic_intr_info[irq].count > 1); ··· 576 615 577 616 rte = find_rte(irq, gsi); 578 617 if (!rte) { 579 - rte = iosapic_alloc_rte(); 618 + rte = kzalloc(sizeof (*rte), GFP_ATOMIC); 580 619 if (!rte) { 581 620 printk(KERN_WARNING "%s: cannot allocate memory\n", 582 621 __func__); ··· 1122 1161 return; 1123 1162 } 1124 1163 #endif 1125 - 1126 - static int __init iosapic_enable_kmalloc (void) 1127 - { 1128 - iosapic_kmalloc_ok = 1; 1129 - return 0; 1130 - } 1131 - core_initcall (iosapic_enable_kmalloc);
+4
arch/ia64/kernel/irq_ia64.c
··· 30 30 #include <linux/bitops.h> 31 31 #include <linux/irq.h> 32 32 #include <linux/ratelimit.h> 33 + #include <linux/acpi.h> 33 34 34 35 #include <asm/delay.h> 35 36 #include <asm/intrinsics.h> ··· 651 650 void __init 652 651 init_IRQ (void) 653 652 { 653 + #ifdef CONFIG_ACPI 654 + acpi_boot_init(); 655 + #endif 654 656 ia64_register_ipi(); 655 657 register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); 656 658 #ifdef CONFIG_SMP
-4
arch/ia64/kernel/setup.c
··· 594 594 cpu_init(); /* initialize the bootstrap CPU */ 595 595 mmu_context_init(); /* initialize context_id bitmap */ 596 596 597 - #ifdef CONFIG_ACPI 598 - acpi_boot_init(); 599 - #endif 600 - 601 597 paravirt_banner(); 602 598 paravirt_arch_setup_console(cmdline_p); 603 599