Commit 024154cf authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

irq: change io_apic_set_pci_routing() to use device parameter

Make actual use of the device parameter passed down to
io_apic_set_pci_routing() - to have the IRQ descriptor
on the home node of the device.

If no device has been passed down, we assume it's a platform
device and use the boot node ID for the IRQ descriptor.

[ Impact: optimization, make IO-APIC code more NUMA aware ]
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <49F6557E.3080101@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent a2f809b0
...@@ -3963,7 +3963,7 @@ int io_apic_set_pci_routing(struct device *dev, int ioapic, int pin, int irq, ...@@ -3963,7 +3963,7 @@ int io_apic_set_pci_routing(struct device *dev, int ioapic, int pin, int irq,
{ {
struct irq_desc *desc; struct irq_desc *desc;
struct irq_cfg *cfg; struct irq_cfg *cfg;
int node = cpu_to_node(boot_cpu_id); int node;
if (!IO_APIC_IRQ(irq)) { if (!IO_APIC_IRQ(irq)) {
apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n", apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n",
...@@ -3971,6 +3971,11 @@ int io_apic_set_pci_routing(struct device *dev, int ioapic, int pin, int irq, ...@@ -3971,6 +3971,11 @@ int io_apic_set_pci_routing(struct device *dev, int ioapic, int pin, int irq,
return -EINVAL; return -EINVAL;
} }
if (dev)
node = dev_to_node(dev);
else
node = cpu_to_node(boot_cpu_id);
desc = irq_to_desc_alloc_node(irq, node); desc = irq_to_desc_alloc_node(irq, node);
if (!desc) { if (!desc) {
printk(KERN_INFO "can not get irq_desc %d\n", irq); printk(KERN_INFO "can not get irq_desc %d\n", irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment