.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Derived from "arch/powerpc/platforms/pseries/pci_dlpar.c" |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Updates, 2005, John Rose <johnrose@austin.ibm.com> |
---|
8 | 9 | * Updates, 2005, Linas Vepstas <linas@austin.ibm.com> |
---|
9 | 10 | * Updates, 2013, Gavin Shan <shangw@linux.vnet.ibm.com> |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License as published by |
---|
13 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
14 | | - * (at your option) any later version. |
---|
15 | 11 | */ |
---|
16 | 12 | |
---|
17 | 13 | #include <linux/pci.h> |
---|
.. | .. |
---|
59 | 55 | void pcibios_release_device(struct pci_dev *dev) |
---|
60 | 56 | { |
---|
61 | 57 | struct pci_controller *phb = pci_bus_to_host(dev->bus); |
---|
62 | | - |
---|
63 | | - eeh_remove_device(dev); |
---|
| 58 | + struct pci_dn *pdn = pci_get_pdn(dev); |
---|
64 | 59 | |
---|
65 | 60 | if (phb->controller_ops.release_device) |
---|
66 | 61 | phb->controller_ops.release_device(dev); |
---|
| 62 | + |
---|
| 63 | + /* free()ing the pci_dn has been deferred to us, do it now */ |
---|
| 64 | + if (pdn && (pdn->flags & PCI_DN_FLAG_DEAD)) { |
---|
| 65 | + pci_dbg(dev, "freeing dead pdn\n"); |
---|
| 66 | + kfree(pdn); |
---|
| 67 | + } |
---|
67 | 68 | } |
---|
68 | 69 | |
---|
69 | 70 | /** |
---|
.. | .. |
---|
109 | 110 | struct pci_controller *phb; |
---|
110 | 111 | struct device_node *dn = pci_bus_to_OF_node(bus); |
---|
111 | 112 | |
---|
112 | | - eeh_add_device_tree_early(PCI_DN(dn)); |
---|
113 | | - |
---|
114 | 113 | phb = pci_bus_to_host(bus); |
---|
115 | 114 | |
---|
116 | 115 | mode = PCI_PROBE_NORMAL; |
---|
.. | .. |
---|
131 | 130 | */ |
---|
132 | 131 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); |
---|
133 | 132 | pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); |
---|
134 | | - pcibios_setup_bus_devices(bus); |
---|
135 | 133 | max = bus->busn_res.start; |
---|
136 | 134 | /* |
---|
137 | 135 | * Scan bridges that are already configured. We don't touch |
---|