aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-30 05:26:43 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:53:44 -0400
commitad9f43340f48c5f7a0a5ef7656986e23d06bf996 (patch)
tree5172aff9c6b0b635686d72ec3e576c8585267ff1
parent48b2650196364e4ef124efb841b63c2326e4ccb2 (diff)
x86: Use sane enumeration
Instead of looping through all interrupts, use the bitmap lookup to find the next. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/apic/io_apic.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 5193f201b916..057b0e13d1c3 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1160,7 +1160,6 @@ void __setup_vector_irq(int cpu)
1160 /* Initialize vector_irq on a new cpu */ 1160 /* Initialize vector_irq on a new cpu */
1161 int irq, vector; 1161 int irq, vector;
1162 struct irq_cfg *cfg; 1162 struct irq_cfg *cfg;
1163 struct irq_desc *desc;
1164 1163
1165 /* 1164 /*
1166 * vector_lock will make sure that we don't run into irq vector 1165 * vector_lock will make sure that we don't run into irq vector
@@ -1169,9 +1168,10 @@ void __setup_vector_irq(int cpu)
1169 */ 1168 */
1170 raw_spin_lock(&vector_lock); 1169 raw_spin_lock(&vector_lock);
1171 /* Mark the inuse vectors */ 1170 /* Mark the inuse vectors */
1172 for_each_irq_desc(irq, desc) { 1171 for_each_active_irq(irq) {
1173 cfg = get_irq_desc_chip_data(desc); 1172 cfg = get_irq_chip_data(irq);
1174 1173 if (!cfg)
1174 continue;
1175 /* 1175 /*
1176 * If it is a legacy IRQ handled by the legacy PIC, this cpu 1176 * If it is a legacy IRQ handled by the legacy PIC, this cpu
1177 * will be part of the irq_cfg's domain. 1177 * will be part of the irq_cfg's domain.
@@ -1516,7 +1516,6 @@ __apicdebuginit(void) print_IO_APIC(void)
1516 union IO_APIC_reg_03 reg_03; 1516 union IO_APIC_reg_03 reg_03;
1517 unsigned long flags; 1517 unsigned long flags;
1518 struct irq_cfg *cfg; 1518 struct irq_cfg *cfg;
1519 struct irq_desc *desc;
1520 unsigned int irq; 1519 unsigned int irq;
1521 1520
1522 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1521 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
@@ -1603,10 +1602,10 @@ __apicdebuginit(void) print_IO_APIC(void)
1603 } 1602 }
1604 } 1603 }
1605 printk(KERN_DEBUG "IRQ to pin mappings:\n"); 1604 printk(KERN_DEBUG "IRQ to pin mappings:\n");
1606 for_each_irq_desc(irq, desc) { 1605 for_each_active_irq(irq) {
1607 struct irq_pin_list *entry; 1606 struct irq_pin_list *entry;
1608 1607
1609 cfg = get_irq_desc_chip_data(desc); 1608 cfg = get_irq_chip_data(irq);
1610 if (!cfg) 1609 if (!cfg)
1611 continue; 1610 continue;
1612 entry = cfg->irq_2_pin; 1611 entry = cfg->irq_2_pin;
@@ -2574,9 +2573,8 @@ static struct irq_chip ir_ioapic_chip __read_mostly = {
2574 2573
2575static inline void init_IO_APIC_traps(void) 2574static inline void init_IO_APIC_traps(void)
2576{ 2575{
2577 int irq;
2578 struct irq_desc *desc;
2579 struct irq_cfg *cfg; 2576 struct irq_cfg *cfg;
2577 unsigned int irq;
2580 2578
2581 /* 2579 /*
2582 * NOTE! The local APIC isn't very good at handling 2580 * NOTE! The local APIC isn't very good at handling
@@ -2589,8 +2587,8 @@ static inline void init_IO_APIC_traps(void)
2589 * Also, we've got to be careful not to trash gate 2587 * Also, we've got to be careful not to trash gate
2590 * 0x80, because int 0x80 is hm, kind of importantish. ;) 2588 * 0x80, because int 0x80 is hm, kind of importantish. ;)
2591 */ 2589 */
2592 for_each_irq_desc(irq, desc) { 2590 for_each_active_irq(irq) {
2593 cfg = get_irq_desc_chip_data(desc); 2591 cfg = get_irq_chip_data(irq);
2594 if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) { 2592 if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) {
2595 /* 2593 /*
2596 * Hmm.. We don't have an entry for this, 2594 * Hmm.. We don't have an entry for this,
@@ -2601,7 +2599,7 @@ static inline void init_IO_APIC_traps(void)
2601 legacy_pic->make_irq(irq); 2599 legacy_pic->make_irq(irq);
2602 else 2600 else
2603 /* Strange. Oh, well.. */ 2601 /* Strange. Oh, well.. */
2604 desc->chip = &no_irq_chip; 2602 set_irq_chip(irq, &no_irq_chip);
2605 } 2603 }
2606 } 2604 }
2607} 2605}