Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158635
b: refs/heads/master
c: f3d1915
h: refs/heads/master
i:
  158633: 5a4bd14
  158631: 2378ea8
v: v3
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed Aug 8, 2009
1 parent 2a437d3 commit d78f138
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce69a784504222c3ab6f1b3c357d09ec5772127a
refs/heads/master: f3d1915a8623b9248572d3ee44e19a80b7a3520b
23 changes: 18 additions & 5 deletions trunk/arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,27 +490,36 @@ static void ioapic_mask_entry(int apic, int pin)
* shared ISA-space IRQs, so we have to support them. We are super
* fast in the common case, and fast for shared ISA-space IRQs.
*/
static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
static int
add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin)
{
struct irq_pin_list **last, *entry;

/* don't allow duplicates */
last = &cfg->irq_2_pin;
for_each_irq_pin(entry, cfg->irq_2_pin) {
if (entry->apic == apic && entry->pin == pin)
return;
return 0;
last = &entry->next;
}

entry = get_one_free_irq_2_pin(node);
if (!entry) {
printk(KERN_ERR "can not alloc irq_pin_list\n");
BUG_ON(1);
printk(KERN_ERR "can not alloc irq_pin_list (%d,%d,%d)\n",
node, apic, pin);
return -ENOMEM;
}
entry->apic = apic;
entry->pin = pin;

*last = entry;
return 0;
}

static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
{
if (add_pin_to_irq_node_nopanic(cfg, node, apic, pin))
panic("IO-APIC: failed to add irq-pin. Can not proceed\n");
}

/*
Expand Down Expand Up @@ -3843,7 +3852,11 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq,
*/
if (irq >= NR_IRQS_LEGACY) {
cfg = desc->chip_data;
add_pin_to_irq_node(cfg, node, ioapic, pin);
if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) {
printk(KERN_INFO "can not add pin %d for irq %d\n",
pin, irq);
return 0;
}
}

setup_IO_APIC_irq(ioapic, pin, irq, desc, trigger, polarity);
Expand Down

0 comments on commit d78f138

Please sign in to comment.