vserver 1.9.5.x5
[linux-2.6.git] / arch / i386 / pci / acpi.c
1 #include <linux/pci.h>
2 #include <linux/acpi.h>
3 #include <linux/init.h>
4 #include <linux/irq.h>
5 #include <asm/hw_irq.h>
6 #include "pci.h"
7
8 struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
9 {
10         if (domain != 0) {
11                 printk(KERN_WARNING "PCI: Multiple domains not supported\n");
12                 return NULL;
13         }
14
15         return pcibios_scan_root(busnum);
16 }
17
18 extern int pci_routeirq;
19 static int __init pci_acpi_init(void)
20 {
21         struct pci_dev *dev = NULL;
22
23         if (pcibios_scanned)
24                 return 0;
25
26         if (acpi_noirq)
27                 return 0;
28
29         printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
30         acpi_irq_penalty_init();
31         pcibios_scanned++;
32         pcibios_enable_irq = acpi_pci_irq_enable;
33
34         if (pci_routeirq) {
35                 /*
36                  * PCI IRQ routing is set up by pci_enable_device(), but we
37                  * also do it here in case there are still broken drivers that
38                  * don't use pci_enable_device().
39                  */
40                 printk(KERN_INFO "** Routing PCI interrupts for all devices because \"pci=routeirq\"\n");
41                 printk(KERN_INFO "** was specified.  If this was required to make a driver work,\n");
42                 printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n");
43                 printk(KERN_INFO "** so I can fix the driver.\n");
44                 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
45                         acpi_pci_irq_enable(dev);
46         } else {
47                 printk(KERN_INFO "** PCI interrupts are no longer routed automatically.  If this\n");
48                 printk(KERN_INFO "** causes a device to stop working, it is probably because the\n");
49                 printk(KERN_INFO "** driver failed to call pci_enable_device().  As a temporary\n");
50                 printk(KERN_INFO "** workaround, the \"pci=routeirq\" argument restores the old\n");
51                 printk(KERN_INFO "** behavior.  If this argument makes the device work again,\n");
52                 printk(KERN_INFO "** please email the output of \"lspci\" to bjorn.helgaas@hp.com\n");
53                 printk(KERN_INFO "** so I can fix the driver.\n");
54         }
55 #ifdef CONFIG_X86_IO_APIC
56         if (acpi_ioapic)
57                 print_IO_APIC();
58 #endif
59
60         return 0;
61 }
62 subsys_initcall(pci_acpi_init);