diff options
author | Andrew Donnellan <andrew.donnellan@au1.ibm.com> | 2016-08-18 09:35:14 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-08-22 03:09:33 +0200 |
commit | 6f38a8b9a45833495dc878c335c5431cd98a16ed (patch) | |
tree | d454aa443853494533788f1b6aad74e1714eb67a /drivers/pci | |
parent | powerpc: mpc8349emitx: Delete unnecessary assignment for the field "owner" (diff) | |
download | linux-6f38a8b9a45833495dc878c335c5431cd98a16ed.tar.xz linux-6f38a8b9a45833495dc878c335c5431cd98a16ed.zip |
cxl: use pcibios_free_controller_deferred() when removing vPHBs
When cxl removes a vPHB, it's possible that the pci_controller may be freed
before all references to the devices on the vPHB have been released. This
in turn causes an invalid memory access when the devices are eventually
released, as pcibios_release_device() attempts to call the phb's
release_device hook.
In cxl_pci_vphb_remove(), remove the existing call to
pcibios_free_controller(). Instead, use
pcibios_free_controller_deferred() to free the pci_controller after all
devices have been released. Export pci_set_host_bridge_release() so we can
do this.
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host-bridge.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index 5f4a2e04c8d7..add66236215c 100644 --- a/drivers/pci/host-bridge.c +++ b/drivers/pci/host-bridge.c @@ -44,6 +44,7 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge, bridge->release_fn = release_fn; bridge->release_data = release_data; } +EXPORT_SYMBOL_GPL(pci_set_host_bridge_release); void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, struct resource *res) |