Skip to content

Commit 4de0a75

Browse files
committed
[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 <[email protected]>
1 parent 899611e commit 4de0a75

File tree

3 files changed

+5
-51
lines changed

3 files changed

+5
-51
lines changed

arch/ia64/kernel/iosapic.c

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@
108108
#define DBG(fmt...)
109109
#endif
110110

111-
#define NR_PREALLOCATE_RTE_ENTRIES \
112-
(PAGE_SIZE / sizeof(struct iosapic_rte_info))
113-
#define RTE_PREALLOCATED (1)
114-
115111
static DEFINE_SPINLOCK(iosapic_lock);
116112

117113
/*
@@ -136,7 +132,6 @@ struct iosapic_rte_info {
136132
struct list_head rte_list; /* RTEs sharing the same vector */
137133
char rte_index; /* IOSAPIC RTE index */
138134
int refcnt; /* reference counter */
139-
unsigned int flags; /* flags */
140135
struct iosapic *iosapic;
141136
} ____cacheline_aligned;
142137

@@ -155,9 +150,6 @@ static struct iosapic_intr_info {
155150

156151
static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */
157152

158-
static int iosapic_kmalloc_ok;
159-
static LIST_HEAD(free_rte_list);
160-
161153
static inline void
162154
iosapic_write(struct iosapic *iosapic, unsigned int reg, u32 val)
163155
{
@@ -552,37 +544,6 @@ iosapic_reassign_vector (int irq)
552544
}
553545
}
554546

555-
static struct iosapic_rte_info * __init_refok iosapic_alloc_rte (void)
556-
{
557-
int i;
558-
struct iosapic_rte_info *rte;
559-
int preallocated = 0;
560-
561-
if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
562-
rte = alloc_bootmem(sizeof(struct iosapic_rte_info) *
563-
NR_PREALLOCATE_RTE_ENTRIES);
564-
for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
565-
list_add(&rte->rte_list, &free_rte_list);
566-
}
567-
568-
if (!list_empty(&free_rte_list)) {
569-
rte = list_entry(free_rte_list.next, struct iosapic_rte_info,
570-
rte_list);
571-
list_del(&rte->rte_list);
572-
preallocated++;
573-
} else {
574-
rte = kmalloc(sizeof(struct iosapic_rte_info), GFP_ATOMIC);
575-
if (!rte)
576-
return NULL;
577-
}
578-
579-
memset(rte, 0, sizeof(struct iosapic_rte_info));
580-
if (preallocated)
581-
rte->flags |= RTE_PREALLOCATED;
582-
583-
return rte;
584-
}
585-
586547
static inline int irq_is_shared (int irq)
587548
{
588549
return (iosapic_intr_info[irq].count > 1);
@@ -615,7 +576,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
615576

616577
rte = find_rte(irq, gsi);
617578
if (!rte) {
618-
rte = iosapic_alloc_rte();
579+
rte = kzalloc(sizeof (*rte), GFP_ATOMIC);
619580
if (!rte) {
620581
printk(KERN_WARNING "%s: cannot allocate memory\n",
621582
__func__);
@@ -1161,10 +1122,3 @@ map_iosapic_to_node(unsigned int gsi_base, int node)
11611122
return;
11621123
}
11631124
#endif
1164-
1165-
static int __init iosapic_enable_kmalloc (void)
1166-
{
1167-
iosapic_kmalloc_ok = 1;
1168-
return 0;
1169-
}
1170-
core_initcall (iosapic_enable_kmalloc);

arch/ia64/kernel/irq_ia64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/bitops.h>
3131
#include <linux/irq.h>
3232
#include <linux/ratelimit.h>
33+
#include <linux/acpi.h>
3334

3435
#include <asm/delay.h>
3536
#include <asm/intrinsics.h>
@@ -650,6 +651,9 @@ ia64_native_register_ipi(void)
650651
void __init
651652
init_IRQ (void)
652653
{
654+
#ifdef CONFIG_ACPI
655+
acpi_boot_init();
656+
#endif
653657
ia64_register_ipi();
654658
register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
655659
#ifdef CONFIG_SMP

arch/ia64/kernel/setup.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,6 @@ setup_arch (char **cmdline_p)
594594
cpu_init(); /* initialize the bootstrap CPU */
595595
mmu_context_init(); /* initialize context_id bitmap */
596596

597-
#ifdef CONFIG_ACPI
598-
acpi_boot_init();
599-
#endif
600-
601597
paravirt_banner();
602598
paravirt_arch_setup_console(cmdline_p);
603599

0 commit comments

Comments
 (0)