linux-uconsole/drivers/pci/controller
Long Li 8aef3824e9 PCI: hv: Fix sleep while in non-sleep context when removing child devices from the bus
[ Upstream commit 41608b64b1 ]

In hv_pci_bus_exit, the code is holding a spinlock while calling
pci_destroy_slot(), which takes a mutex.

This is not safe for spinlock. Fix this by moving the children to be
deleted to a list on the stack, and removing them after spinlock is
released.

Fixes: 94d2276320 ("PCI: hv: Fix a race condition when removing the device")

Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Rob Herring <robh@kernel.org>
Cc: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michael Kelley <mikelley@microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/linux-hyperv/20210823152130.GA21501@kili/
Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/1630365207-20616-1-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-10-13 10:04:25 +02:00
..
cadence treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
dwc PCI: tegra194: Fix MSI-X programming 2021-09-22 12:28:00 +02:00
mobiveil
Kconfig
Makefile
pci-aardvark.c PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response 2021-09-30 10:10:58 +02:00
pci-ftpci100.c PCI: ftpci100: Rename macro name collision 2021-07-20 16:05:46 +02:00
pci-host-common.c
pci-host-generic.c
pci-hyperv-intf.c
pci-hyperv.c PCI: hv: Fix sleep while in non-sleep context when removing child devices from the bus 2021-10-13 10:04:25 +02:00
pci-loongson.c
pci-mvebu.c PCI: mvebu: Fix duplicate resource requests 2020-11-04 13:55:30 -06:00
pci-rcar-gen2.c
pci-tegra.c PCI: tegra: Fix OF node reference leak 2021-09-22 12:28:00 +02:00
pci-thunder-ecam.c PCI: thunder: Fix compile testing 2021-05-22 11:40:52 +02:00
pci-thunder-pem.c PCI: thunder: Fix compile testing 2021-05-22 11:40:52 +02:00
pci-v3-semi.c
pci-versatile.c
pci-xgene-msi.c PCI: xgene-msi: Fix race in installing chained irq handler 2021-03-17 17:06:24 +01:00
pci-xgene.c PCI: xgene: Fix cfg resource mapping 2021-05-14 09:49:57 +02:00
pcie-altera-msi.c
pcie-altera.c
pcie-brcmstb.c PCI: brcmstb: Initialize "tmp" before use 2020-12-30 11:53:18 +01:00
pcie-hisi-error.c
pcie-iproc-bcma.c PCI: iproc: Fix BCMA probe resource handling 2021-09-22 12:28:02 +02:00
pcie-iproc-msi.c PCI: iproc: Support multi-MSI only on uniprocessor kernel 2021-07-20 16:05:52 +02:00
pcie-iproc-platform.c
pcie-iproc.c PCI: iproc: Invalidate correct PAXB inbound windows 2020-12-30 11:53:27 +01:00
pcie-iproc.h
pcie-mediatek.c PCI: mediatek: Add missing of_node_put() to fix reference leak 2021-03-17 17:06:24 +01:00
pcie-rcar-ep.c PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe() 2021-09-22 12:28:00 +02:00
pcie-rcar-host.c PCI: rcar: Always allocate MSI addresses in 32bit space 2021-03-04 11:38:11 +01:00
pcie-rcar.c
pcie-rcar.h
pcie-rockchip-ep.c
pcie-rockchip-host.c PCI: rockchip: Register IRQ handlers after device and data are ready 2021-07-20 16:05:49 +02:00
pcie-rockchip.c PCI: rockchip: Make 'ep-gpios' DT property optional 2021-03-04 11:38:18 +01:00
pcie-rockchip.h
pcie-tango.c
pcie-xilinx-cpm.c PCI: xilinx-cpm: Fix reference count leak on error path 2021-03-04 11:38:11 +01:00
pcie-xilinx-nwl.c PCI: xilinx-nwl: Enable the clock through CCF 2021-09-18 13:40:10 +02:00
pcie-xilinx.c
vmd.c