hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/kernel/pci-hotplug.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Derived from "arch/powerpc/platforms/pseries/pci_dlpar.c"
34 *
....@@ -7,11 +8,6 @@
78 * Updates, 2005, John Rose <johnrose@austin.ibm.com>
89 * Updates, 2005, Linas Vepstas <linas@austin.ibm.com>
910 * 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.
1511 */
1612
1713 #include <linux/pci.h>
....@@ -59,11 +55,16 @@
5955 void pcibios_release_device(struct pci_dev *dev)
6056 {
6157 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);
6459
6560 if (phb->controller_ops.release_device)
6661 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
+ }
6768 }
6869
6970 /**
....@@ -109,8 +110,6 @@
109110 struct pci_controller *phb;
110111 struct device_node *dn = pci_bus_to_OF_node(bus);
111112
112
- eeh_add_device_tree_early(PCI_DN(dn));
113
-
114113 phb = pci_bus_to_host(bus);
115114
116115 mode = PCI_PROBE_NORMAL;
....@@ -131,7 +130,6 @@
131130 */
132131 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
133132 pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
134
- pcibios_setup_bus_devices(bus);
135133 max = bus->busn_res.start;
136134 /*
137135 * Scan bridges that are already configured. We don't touch