aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/io_apic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-23 08:52:16 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-23 11:26:50 -0500
commitda1ad9d7b2477594e8ff43706644ba8a375ad62a (patch)
tree38f7d23ba0c9439315c3fca5bb4aaeecff9eddd5 /arch/x86/kernel/apic/io_apic.c
parent2d57e37dbf648fd6547752b8954f4104a85f4b15 (diff)
x86: ioapic: Use setup function in setup_IO_APIC_irq_extra()
Another version of the same thing. Only set the pin programmed, when the setup function succeeds. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r--arch/x86/kernel/apic/io_apic.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 63140d86759f..cfd9611036cc 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1447,7 +1447,7 @@ static void __init setup_IO_APIC_irqs(void)
1447void setup_IO_APIC_irq_extra(u32 gsi) 1447void setup_IO_APIC_irq_extra(u32 gsi)
1448{ 1448{
1449 int apic_id = 0, pin, idx, irq, node = cpu_to_node(0); 1449 int apic_id = 0, pin, idx, irq, node = cpu_to_node(0);
1450 struct irq_cfg *cfg; 1450 struct io_apic_irq_attr attr;
1451 1451
1452 /* 1452 /*
1453 * Convert 'gsi' to 'ioapic.pin'. 1453 * Convert 'gsi' to 'ioapic.pin'.
@@ -1467,21 +1467,17 @@ void setup_IO_APIC_irq_extra(u32 gsi)
1467 if (apic_id == 0 || irq < NR_IRQS_LEGACY) 1467 if (apic_id == 0 || irq < NR_IRQS_LEGACY)
1468 return; 1468 return;
1469 1469
1470 cfg = alloc_irq_and_cfg_at(irq, node);
1471 if (!cfg)
1472 return;
1473
1474 add_pin_to_irq_node(cfg, node, apic_id, pin);
1475
1476 if (test_bit(pin, mp_ioapic_routing[apic_id].pin_programmed)) { 1470 if (test_bit(pin, mp_ioapic_routing[apic_id].pin_programmed)) {
1477 pr_debug("Pin %d-%d already programmed\n", 1471 pr_debug("Pin %d-%d already programmed\n",
1478 mp_ioapics[apic_id].apicid, pin); 1472 mp_ioapics[apic_id].apicid, pin);
1479 return; 1473 return;
1480 } 1474 }
1481 set_bit(pin, mp_ioapic_routing[apic_id].pin_programmed);
1482 1475
1483 setup_ioapic_irq(apic_id, pin, irq, cfg, 1476 set_io_apic_irq_attr(&attr, apic_id, pin, irq_trigger(idx),
1484 irq_trigger(idx), irq_polarity(idx)); 1477 irq_polarity(idx));
1478
1479 if (!io_apic_setup_irq_pin(irq, node, &attr))
1480 set_bit(pin, mp_ioapic_routing[apic_id].pin_programmed);
1485} 1481}
1486 1482
1487/* 1483/*