]> err.no Git - linux-2.6/blobdiff - arch/x86/pci/acpi.c
x86/pci: add pci=skip_isa_align command lines.
[linux-2.6] / arch / x86 / pci / acpi.c
index 0234f2831bf371194f69779753ce2fb017570984..d95de2f199cdaf45c3b44663dc32ed884de98b1d 100644 (file)
@@ -6,45 +6,6 @@
 #include <asm/numa.h>
 #include "pci.h"
 
-static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
-{
-       pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
-       printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
-       return 0;
-}
-
-static struct dmi_system_id acpi_pciprobe_dmi_table[] __devinitdata = {
-/*
- * Systems where PCI IO resource ISA alignment can be skipped
- * when the ISA enable bit in the bridge control is not set
- */
-       {
-               .callback = can_skip_ioresource_align,
-               .ident = "IBM System x3800",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
-               },
-       },
-       {
-               .callback = can_skip_ioresource_align,
-               .ident = "IBM System x3850",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
-               },
-       },
-       {
-               .callback = can_skip_ioresource_align,
-               .ident = "IBM System x3950",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
-               },
-       },
-       {}
-};
-
 struct pci_root_info {
        char *name;
        unsigned int res_num;
@@ -151,7 +112,7 @@ adjust_transparent_bridge_resources(struct pci_bus *bus)
 
 static void
 get_current_resources(struct acpi_device *device, int busnum,
-                       struct pci_bus *bus)
+                       int domain, struct pci_bus *bus)
 {
        struct pci_root_info info;
        size_t size;
@@ -168,10 +129,10 @@ get_current_resources(struct acpi_device *device, int busnum,
        if (!info.res)
                goto res_alloc_fail;
 
-       info.name = kmalloc(12, GFP_KERNEL);
+       info.name = kmalloc(16, GFP_KERNEL);
        if (!info.name)
                goto name_alloc_fail;
-       sprintf(info.name, "PCI Bus #%02x", busnum);
+       sprintf(info.name, "PCI Bus %04x:%02x", domain, busnum);
 
        info.res_num = 0;
        acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
@@ -191,9 +152,10 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
 {
        struct pci_bus *bus;
        struct pci_sysdata *sd;
+       int node;
+#ifdef CONFIG_ACPI_NUMA
        int pxm;
-
-       dmi_check_system(acpi_pciprobe_dmi_table);
+#endif
 
        if (domain && !pci_domains_supported) {
                printk(KERN_WARNING "PCI: Multiple domains not supported "
@@ -201,6 +163,17 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
                return NULL;
        }
 
+       node = -1;
+#ifdef CONFIG_ACPI_NUMA
+       pxm = acpi_get_pxm(device->handle);
+       if (pxm >= 0)
+               node = pxm_to_node(pxm);
+       if (node != -1)
+               set_mp_bus_to_node(busnum, node);
+       else
+               node = get_mp_bus_to_node(busnum);
+#endif
+
        /* Allocate per-root-bus (not per bus) arch-specific data.
         * TODO: leak; this memory is never freed.
         * It's arguable whether it's worth the trouble to care.
@@ -212,30 +185,36 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
        }
 
        sd->domain = domain;
-       sd->node = -1;
-
-       pxm = acpi_get_pxm(device->handle);
-#ifdef CONFIG_ACPI_NUMA
-       if (pxm >= 0)
-               sd->node = pxm_to_node(pxm);
-#endif
+       sd->node = node;
+       /*
+        * Maybe the desired pci bus has been already scanned. In such case
+        * it is unnecessary to scan the pci bus with the given domain,busnum.
+        */
+       bus = pci_find_bus(domain, busnum);
+       if (bus) {
+               /*
+                * If the desired bus exits, the content of bus->sysdata will
+                * be replaced by sd.
+                */
+               memcpy(bus->sysdata, sd, sizeof(*sd));
+               kfree(sd);
+       } else
+               bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
 
-       bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
        if (!bus)
                kfree(sd);
 
 #ifdef CONFIG_ACPI_NUMA
-       if (bus != NULL) {
+       if (bus) {
                if (pxm >= 0) {
-                       printk("bus %d -> pxm %d -> node %d\n",
-                               busnum, pxm, sd->node);
+                       printk(KERN_DEBUG "bus %02x -> pxm %d -> node %d\n",
+                               busnum, pxm, pxm_to_node(pxm));
                }
        }
 #endif
 
        if (bus && (pci_probe & PCI_USE__CRS))
-               get_current_resources(device, busnum, bus);
-       
+               get_current_resources(device, busnum, domain, bus);
        return bus;
 }
 
@@ -265,8 +244,7 @@ static int __init pci_acpi_init(void)
                printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
                for_each_pci_dev(dev)
                        acpi_pci_irq_enable(dev);
-       } else
-               printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\".  If it helps, post a report\n");
+       }
 
 #ifdef CONFIG_X86_IO_APIC
        if (acpi_ioapic)