diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/pci_dlpar.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/pci_dlpar.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index 3ccebc83dc02..261a577a3dd2 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
@@ -65,27 +65,43 @@ pcibios_find_pci_bus(struct device_node *dn) | |||
65 | EXPORT_SYMBOL_GPL(pcibios_find_pci_bus); | 65 | EXPORT_SYMBOL_GPL(pcibios_find_pci_bus); |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * pcibios_remove_pci_devices - remove all devices under this bus | 68 | * __pcibios_remove_pci_devices - remove all devices under this bus |
69 | * @bus: the indicated PCI bus | ||
70 | * @purge_pe: destroy the PE on removal of PCI devices | ||
69 | * | 71 | * |
70 | * Remove all of the PCI devices under this bus both from the | 72 | * Remove all of the PCI devices under this bus both from the |
71 | * linux pci device tree, and from the powerpc EEH address cache. | 73 | * linux pci device tree, and from the powerpc EEH address cache. |
74 | * By default, the corresponding PE will be destroied during the | ||
75 | * normal PCI hotplug path. For PCI hotplug during EEH recovery, | ||
76 | * the corresponding PE won't be destroied and deallocated. | ||
72 | */ | 77 | */ |
73 | void pcibios_remove_pci_devices(struct pci_bus *bus) | 78 | void __pcibios_remove_pci_devices(struct pci_bus *bus, int purge_pe) |
74 | { | 79 | { |
75 | struct pci_dev *dev, *tmp; | 80 | struct pci_dev *dev, *tmp; |
76 | struct pci_bus *child_bus; | 81 | struct pci_bus *child_bus; |
77 | 82 | ||
78 | /* First go down child busses */ | 83 | /* First go down child busses */ |
79 | list_for_each_entry(child_bus, &bus->children, node) | 84 | list_for_each_entry(child_bus, &bus->children, node) |
80 | pcibios_remove_pci_devices(child_bus); | 85 | __pcibios_remove_pci_devices(child_bus, purge_pe); |
81 | 86 | ||
82 | pr_debug("PCI: Removing devices on bus %04x:%02x\n", | 87 | pr_debug("PCI: Removing devices on bus %04x:%02x\n", |
83 | pci_domain_nr(bus), bus->number); | 88 | pci_domain_nr(bus), bus->number); |
84 | list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { | 89 | list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { |
85 | pr_debug(" * Removing %s...\n", pci_name(dev)); | 90 | pr_debug(" * Removing %s...\n", pci_name(dev)); |
86 | eeh_remove_bus_device(dev); | 91 | eeh_remove_bus_device(dev, purge_pe); |
87 | pci_stop_and_remove_bus_device(dev); | 92 | pci_stop_and_remove_bus_device(dev); |
88 | } | 93 | } |
94 | } | ||
95 | |||
96 | /** | ||
97 | * pcibios_remove_pci_devices - remove all devices under this bus | ||
98 | * | ||
99 | * Remove all of the PCI devices under this bus both from the | ||
100 | * linux pci device tree, and from the powerpc EEH address cache. | ||
101 | */ | ||
102 | void pcibios_remove_pci_devices(struct pci_bus *bus) | ||
103 | { | ||
104 | __pcibios_remove_pci_devices(bus, 1); | ||
89 | } | 105 | } |
90 | EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices); | 106 | EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices); |
91 | 107 | ||