]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/pseries/pci_dlpar.c
powerpc/pci: Properly allocate bus resources for hotplug PHBs
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / pseries / pci_dlpar.c
index 5a5a19e40bb4587e80943991e8ebfc9621bbfd7b..31481dc485de85f404f5adf07d558bc644f32742 100644 (file)
@@ -88,11 +88,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus)
        struct pci_dev *dev;
 
        list_for_each_entry(dev, &bus->devices, bus_list) {
-               /*
-                * Skip already-present devices (which are on the
-                * global device list.)
-                */
-               if (list_empty(&dev->global_list)) {
+               /* Skip already-added devices */
+               if (!dev->is_added) {
                        int i;
 
                        /* Fill device archdata and setup iommu table */
@@ -123,7 +120,7 @@ pcibios_pci_config_bridge(struct pci_dev *dev)
        /* Add to children of PCI bridge dev->bus */
        child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
        if (!child_bus) {
-               printk (KERN_ERR "%s: could not add second bus\n", __FUNCTION__);
+               printk (KERN_ERR "%s: could not add second bus\n", __func__);
                return -EIO;
        }
        sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
@@ -192,6 +189,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
 {
        struct pci_controller *phb;
        int primary;
+       struct pci_bus *b;
 
        primary = list_empty(&hose_list);
        phb = pcibios_alloc_controller(dn);
@@ -206,6 +204,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
                eeh_add_device_tree_early(dn);
 
        scan_phb(phb);
+       pcibios_allocate_bus_resources(phb->bus);
        pcibios_fixup_new_pci_devices(phb->bus);
        pci_bus_add_devices(phb->bus);
        eeh_add_device_tree_late(phb->bus);