aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/sgi_hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/sgi_hotplug.c')
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index b62ad31a9739..5d188c558386 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -205,21 +205,6 @@ static struct hotplug_slot * sn_hp_destroy(void)
205 return bss_hotplug_slot; 205 return bss_hotplug_slot;
206} 206}
207 207
208static void sn_bus_alloc_data(struct pci_dev *dev)
209{
210 struct pci_bus *subordinate_bus;
211 struct pci_dev *child;
212
213 sn_pci_fixup_slot(dev);
214
215 /* Recursively sets up the sn_irq_info structs */
216 if (dev->subordinate) {
217 subordinate_bus = dev->subordinate;
218 list_for_each_entry(child, &subordinate_bus->devices, bus_list)
219 sn_bus_alloc_data(child);
220 }
221}
222
223static void sn_bus_free_data(struct pci_dev *dev) 208static void sn_bus_free_data(struct pci_dev *dev)
224{ 209{
225 struct pci_bus *subordinate_bus; 210 struct pci_bus *subordinate_bus;
@@ -337,6 +322,11 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
337 return rc; 322 return rc;
338} 323}
339 324
325/*
326 * Power up and configure the slot via a SAL call to PROM.
327 * Scan slot (and any children), do any platform specific fixup,
328 * and find device driver.
329 */
340static int enable_slot(struct hotplug_slot *bss_hotplug_slot) 330static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
341{ 331{
342 struct slot *slot = bss_hotplug_slot->private; 332 struct slot *slot = bss_hotplug_slot->private;
@@ -345,6 +335,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
345 int func, num_funcs; 335 int func, num_funcs;
346 int new_ppb = 0; 336 int new_ppb = 0;
347 int rc; 337 int rc;
338 void pcibios_fixup_device_resources(struct pci_dev *);
348 339
349 /* Serialize the Linux PCI infrastructure */ 340 /* Serialize the Linux PCI infrastructure */
350 mutex_lock(&sn_hotplug_mutex); 341 mutex_lock(&sn_hotplug_mutex);
@@ -367,9 +358,6 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
367 return -ENODEV; 358 return -ENODEV;
368 } 359 }
369 360
370 sn_pci_controller_fixup(pci_domain_nr(slot->pci_bus),
371 slot->pci_bus->number,
372 slot->pci_bus);
373 /* 361 /*
374 * Map SN resources for all functions on the card 362 * Map SN resources for all functions on the card
375 * to the Linux PCI interface and tell the drivers 363 * to the Linux PCI interface and tell the drivers
@@ -380,6 +368,13 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
380 PCI_DEVFN(slot->device_num + 1, 368 PCI_DEVFN(slot->device_num + 1,
381 PCI_FUNC(func))); 369 PCI_FUNC(func)));
382 if (dev) { 370 if (dev) {
371 /* Need to do slot fixup on PPB before fixup of children
372 * (PPB's pcidev_info needs to be in pcidev_info list
373 * before child's SN_PCIDEV_INFO() call to setup
374 * pdi_host_pcidev_info).
375 */
376 pcibios_fixup_device_resources(dev);
377 sn_pci_fixup_slot(dev);
383 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 378 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
384 unsigned char sec_bus; 379 unsigned char sec_bus;
385 pci_read_config_byte(dev, PCI_SECONDARY_BUS, 380 pci_read_config_byte(dev, PCI_SECONDARY_BUS,
@@ -387,12 +382,8 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
387 new_bus = pci_add_new_bus(dev->bus, dev, 382 new_bus = pci_add_new_bus(dev->bus, dev,
388 sec_bus); 383 sec_bus);
389 pci_scan_child_bus(new_bus); 384 pci_scan_child_bus(new_bus);
390 sn_pci_controller_fixup(pci_domain_nr(new_bus),
391 new_bus->number,
392 new_bus);
393 new_ppb = 1; 385 new_ppb = 1;
394 } 386 }
395 sn_bus_alloc_data(dev);
396 pci_dev_put(dev); 387 pci_dev_put(dev);
397 } 388 }
398 } 389 }