2 #include <linux/acpi.h>
3 #include <linux/init.h>
8 struct pci_bus
* __devinit
pci_acpi_scan_root(struct acpi_device
*device
, int domain
, int busnum
)
11 struct pci_sysdata
*sd
;
14 /* Allocate per-root-bus (not per bus) arch-specific data.
15 * TODO: leak; this memory is never freed.
16 * It's arguable whether it's worth the trouble to care.
18 sd
= kzalloc(sizeof(*sd
), GFP_KERNEL
);
20 printk(KERN_ERR
"PCI: OOM, not probing PCI bus %02x\n", busnum
);
25 printk(KERN_WARNING
"PCI: Multiple domains not supported\n");
32 pxm
= acpi_get_pxm(device
->handle
);
33 #ifdef CONFIG_ACPI_NUMA
35 sd
->node
= pxm_to_node(pxm
);
38 bus
= pci_scan_bus_parented(NULL
, busnum
, &pci_root_ops
, sd
);
42 #ifdef CONFIG_ACPI_NUMA
45 printk("bus %d -> pxm %d -> node %d\n",
46 busnum
, pxm
, sd
->node
);
54 extern int pci_routeirq
;
55 static int __init
pci_acpi_init(void)
57 struct pci_dev
*dev
= NULL
;
65 printk(KERN_INFO
"PCI: Using ACPI for IRQ routing\n");
66 acpi_irq_penalty_init();
68 pcibios_enable_irq
= acpi_pci_irq_enable
;
69 pcibios_disable_irq
= acpi_pci_irq_disable
;
73 * PCI IRQ routing is set up by pci_enable_device(), but we
74 * also do it here in case there are still broken drivers that
75 * don't use pci_enable_device().
77 printk(KERN_INFO
"PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
79 acpi_pci_irq_enable(dev
);
81 printk(KERN_INFO
"PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
83 #ifdef CONFIG_X86_IO_APIC
90 subsys_initcall(pci_acpi_init
);