From: Andrew Morton Signed-off-by: Andrew Morton --- drivers/pci/hotplug/sgi_hotplug.c | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff -puN drivers/pci/hotplug/sgi_hotplug.c~revert-gregkh-pci-altix-sn-acpi-hotplug-support drivers/pci/hotplug/sgi_hotplug.c --- a/drivers/pci/hotplug/sgi_hotplug.c~revert-gregkh-pci-altix-sn-acpi-hotplug-support +++ a/drivers/pci/hotplug/sgi_hotplug.c @@ -205,6 +205,21 @@ static struct hotplug_slot * sn_hp_destr return bss_hotplug_slot; } +static void sn_bus_alloc_data(struct pci_dev *dev) +{ + struct pci_bus *subordinate_bus; + struct pci_dev *child; + + sn_pci_fixup_slot(dev); + + /* Recursively sets up the sn_irq_info structs */ + if (dev->subordinate) { + subordinate_bus = dev->subordinate; + list_for_each_entry(child, &subordinate_bus->devices, bus_list) + sn_bus_alloc_data(child); + } +} + static void sn_bus_free_data(struct pci_dev *dev) { struct pci_bus *subordinate_bus; @@ -322,11 +337,6 @@ static int sn_slot_disable(struct hotplu return rc; } -/* - * Power up and configure the slot via a SAL call to PROM. - * Scan slot (and any children), do any platform specific fixup, - * and find device driver. - */ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) { struct slot *slot = bss_hotplug_slot->private; @@ -357,6 +367,9 @@ static int enable_slot(struct hotplug_sl return -ENODEV; } + sn_pci_controller_fixup(pci_domain_nr(slot->pci_bus), + slot->pci_bus->number, + slot->pci_bus); /* * Map SN resources for all functions on the card * to the Linux PCI interface and tell the drivers @@ -367,13 +380,6 @@ static int enable_slot(struct hotplug_sl PCI_DEVFN(slot->device_num + 1, PCI_FUNC(func))); if (dev) { - /* Need to do slot fixup on PPB before fixup of children - * (PPB's pcidev_info needs to be in pcidev_info list - * before child's SN_PCIDEV_INFO() call to setup - * pdi_host_pcidev_info). - */ - pcibios_fixup_device_resources(dev); - sn_pci_fixup_slot(dev); if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { unsigned char sec_bus; pci_read_config_byte(dev, PCI_SECONDARY_BUS, @@ -381,8 +387,12 @@ static int enable_slot(struct hotplug_sl new_bus = pci_add_new_bus(dev->bus, dev, sec_bus); pci_scan_child_bus(new_bus); + sn_pci_controller_fixup(pci_domain_nr(new_bus), + new_bus->number, + new_bus); new_ppb = 1; } + sn_bus_alloc_data(dev); pci_dev_put(dev); } } _