linux-stable/drivers/misc/cxl
Andrew Donnellan 6f38a8b9a4 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>
2016-08-22 11:09:33 +10:00
..
api.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
base.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
context.c cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests 2016-08-09 16:52:02 +10:00
cxl.h cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests 2016-08-09 16:52:02 +10:00
debugfs.c cxl: Abstract the differences between the PSL and XSL 2016-06-16 23:08:54 +10:00
fault.c powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED 2016-05-01 18:32:26 +10:00
file.c cxl: Add mechanism for delivering AFU driver specific events 2016-06-28 18:34:56 +10:00
flash.c cxl: static-ify variables to fix sparse warnings 2016-06-16 22:49:27 +10:00
guest.c cxl: fix potential NULL dereference in free_adapter() 2016-07-19 20:12:29 +10:00
hcalls.c cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Refine slice error debug messages 2016-07-08 22:22:03 +10:00
Kconfig cxl: remove dead Kconfig options 2016-07-19 20:12:29 +10:00
main.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
Makefile cxl: Allow a default context to be associated with an external pci_dev 2016-07-14 20:26:52 +10:00
native.c cxl: Fix sparse warnings 2016-08-09 16:52:02 +10:00
of.c cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
pci.c cxl: Set psl_fir_cntl to production environment value 2016-08-10 14:02:45 +10:00
phb.c cxl: Allow a default context to be associated with an external pci_dev 2016-07-14 20:26:52 +10:00
sysfs.c cxl: Allow initialization on timebase sync failures 2016-04-22 21:45:44 +10:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
vphb.c cxl: use pcibios_free_controller_deferred() when removing vPHBs 2016-08-22 11:09:33 +10:00