linux/drivers/pci/controller
Dexuan Cui 15becc2b56 PCI: hv: Add hv_pci_remove_slots() when we unload the driver
When we unload the pci-hyperv host controller driver, the host does not
send us a PCI_EJECT message.

In this case we also need to make sure the sysfs PCI slot directory is
removed, otherwise a command on a slot file eg:

"cat /sys/bus/pci/slots/2/address"

will trigger a

"BUG: unable to handle kernel paging request"

and, if we unload/reload the driver several times we would end up with
stale slot entries in PCI slot directories in /sys/bus/pci/slots/

root@localhost:~# ls -rtl  /sys/bus/pci/slots/
total 0
drwxr-xr-x 2 root root 0 Feb  7 10:49 2
drwxr-xr-x 2 root root 0 Feb  7 10:49 2-1
drwxr-xr-x 2 root root 0 Feb  7 10:51 2-2

Add the missing code to remove the PCI slot and fix the current
behaviour.

Fixes: a15f2c08c7 ("PCI: hv: support reporting serial number as slot information")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
[lorenzo.pieralisi@arm.com: reformatted the log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Cc: stable@vger.kernel.org
2019-03-26 19:40:40 +00:00
..
dwc pci-v5.1-changes 2019-03-09 14:57:08 -08:00
Kconfig PCI: altera: Enable driver on ARM64 2019-03-04 12:22:19 +00:00
Makefile PCI: mobiveil: Add Kconfig/Makefile entries 2018-07-30 14:30:16 +01:00
pci-aardvark.c PCI: aardvark: Make symbol 'advk_pci_bridge_emul_ops' static 2019-03-01 15:23:06 +00:00
pci-ftpci100.c PCI: faraday: Fix I/O space page leak 2018-07-18 17:01:14 -05:00
pci-host-common.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pci-host-generic.c
pci-hyperv.c PCI: hv: Add hv_pci_remove_slots() when we unload the driver 2019-03-26 19:40:40 +00:00
pci-mvebu.c PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags 2019-02-22 10:51:14 +00:00
pci-rcar-gen2.c
pci-tegra.c
pci-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c PCI: v3-semi: Fix I/O space page leak 2018-07-18 17:02:13 -05:00
pci-versatile.c PCI: versatile: Fix I/O space page leak 2018-07-18 17:00:11 -05:00
pci-xgene-msi.c
pci-xgene.c PCI: xgene: Fix I/O space page leak 2018-07-18 16:59:40 -05:00
pcie-altera-msi.c
pcie-altera.c PCI: altera: Add Stratix 10 PCIe support 2019-03-04 12:22:03 +00:00
pcie-cadence-ep.c PCI: cadence: Remove pci_epf_linkup() from Cadence EP driver 2019-02-15 10:02:38 +00:00
pcie-cadence-host.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-cadence.c pci-v4.20-changes 2018-10-25 06:50:48 -07:00
pcie-cadence.h PCI: cadence: Add Power Management ops for host and EP 2018-07-12 12:44:14 +01:00
pcie-iproc-bcma.c
pcie-iproc-msi.c cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
pcie-iproc-platform.c
pcie-iproc.c PCI: iproc: Remove PAXC slot check to allow VF support 2018-09-18 10:13:04 +01:00
pcie-iproc.h PCI: iproc: Reject unconfigured physical functions from PAXC 2018-07-13 11:56:55 +01:00
pcie-mediatek.c PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM 2019-03-01 11:22:21 +00:00
pcie-mobiveil.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-rcar.c PCI: rcar: Add the initialization of PCIe link in resume_noirq() 2019-03-26 11:14:13 +00:00
pcie-rockchip-ep.c PCI: rockchip: Remove pci_epf_linkup() from Rockchip EP driver 2019-02-15 10:02:50 +00:00
pcie-rockchip-host.c
pcie-rockchip.c
pcie-rockchip.h
pcie-tango.c
pcie-xilinx-nwl.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-xilinx.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
vmd.c PCI/VMD: Configure MPS settings before adding devices 2019-01-30 11:00:04 +00:00