kernel-fxtec-pro1x/drivers/pci
Jon Derrick 80a23f70d5 PCI: vmd: Detach resources after stopping root bus
[ Upstream commit dc8af3a827df6d4bb925d3b81b7ec94a7cce9482 ]

The VMD removal path calls pci_stop_root_busi(), which tears down the pcie
tree, including detaching all of the attached drivers. During driver
detachment, devices may use pci_release_region() to release resources.
This path relies on the resource being accessible in resource tree.

By detaching the child domain from the parent resource domain prior to
stopping the bus, we are preventing the list traversal from finding the
resource to be freed. If we instead detach the resource after stopping
the bus, we will have properly freed the resource and detaching is
simply accounting at that point.

Without this order, the resource is never freed and is orphaned on VMD
removal, leading to a warning:

[  181.940162] Trying to free nonexistent resource <e5a10000-e5a13fff>

Fixes: 2c2c5c5cd2 ("x86/PCI: VMD: Attach VMD resources to parent domain's resource tree")
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:16:37 +01:00
..
controller PCI: vmd: Detach resources after stopping root bus 2019-12-01 09:16:37 +01:00
endpoint
hotplug PCI: portdrv: Initialize service drivers directly 2019-11-20 18:47:10 +01:00
pcie PCI/ERR: Run error recovery callbacks for all affected devices 2019-11-20 18:47:39 +01:00
switch
access.c
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c
Kconfig
Makefile
mmap.c
msi.c
of.c
pci-acpi.c
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c
pci.c PCI/ERR: Use slot reset if available 2019-11-20 18:47:13 +01:00
pci.h PCI/ERR: Use slot reset if available 2019-11-20 18:47:13 +01:00
probe.c
proc.c
quirks.c PCI: Fix Switchtec DMA aliasing quirk dmesg noise 2019-11-06 13:05:21 +01:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
slot.c PCI/ERR: Use slot reset if available 2019-11-20 18:47:13 +01:00
syscall.c
vc.c
vpd.c
xen-pcifront.c