@@ -205,21 +205,6 @@ static struct hotplug_slot * sn_hp_destroy(void)
205205 return bss_hotplug_slot ;
206206}
207207
208- static 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-
223208static void sn_bus_free_data (struct pci_dev * dev )
224209{
225210 struct pci_bus * subordinate_bus ;
@@ -337,6 +322,11 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
337322 return rc ;
338323}
339324
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+ */
340330static int enable_slot (struct hotplug_slot * bss_hotplug_slot )
341331{
342332 struct slot * slot = bss_hotplug_slot -> private ;
@@ -345,6 +335,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
345335 int func , num_funcs ;
346336 int new_ppb = 0 ;
347337 int rc ;
338+ void pcibios_fixup_device_resources (struct pci_dev * );
348339
349340 /* Serialize the Linux PCI infrastructure */
350341 mutex_lock (& sn_hotplug_mutex );
@@ -367,9 +358,6 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
367358 return - ENODEV ;
368359 }
369360
370- sn_pci_controller_fixup (pci_domain_nr (slot -> pci_bus ),
371- slot -> pci_bus -> number ,
372- slot -> pci_bus );
373361 /*
374362 * Map SN resources for all functions on the card
375363 * to the Linux PCI interface and tell the drivers
@@ -380,19 +368,22 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
380368 PCI_DEVFN (slot -> device_num + 1 ,
381369 PCI_FUNC (func )));
382370 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 );
383378 if (dev -> hdr_type == PCI_HEADER_TYPE_BRIDGE ) {
384379 unsigned char sec_bus ;
385380 pci_read_config_byte (dev , PCI_SECONDARY_BUS ,
386381 & sec_bus );
387382 new_bus = pci_add_new_bus (dev -> bus , dev ,
388383 sec_bus );
389384 pci_scan_child_bus (new_bus );
390- sn_pci_controller_fixup (pci_domain_nr (new_bus ),
391- new_bus -> number ,
392- new_bus );
393385 new_ppb = 1 ;
394386 }
395- sn_bus_alloc_data (dev );
396387 pci_dev_put (dev );
397388 }
398389 }
0 commit comments