linux/drivers/pci/host
Brian Norris a5f40e8098 PCI: Don't allow unbinding host controllers that aren't prepared
Many PCI host controller drivers aren't prepared to have their devices
unbound from them forcefully (e.g., through /sys/.../<driver>/unbind), as
they don't provide any driver .remove callback, where they'd detach the
root bus, release resources, etc. Keeping the driver built in (i.e., not a
loadable module) is not enough; and providing no .remove callback just
means we don't do any teardown.

To rule out the possibility of unbinding a device via sysfs, we need to set
the ".suppress_bind_attrs" field.

I found the suspect drivers via the following search:

  git grep -l platform_driver $(git grep -L -e '\.remove' -e suppress_bind_attrs drivers/pci/)

Then I inspected them to ensure that
(a) they set up a PCI bus in their probe() and
(b) they don't have a remove() callback for undoing the setup

Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2017-04-28 10:38:00 -05:00
..
Kconfig Merge branch 'pci/host-rockchip' into next 2017-04-28 10:33:10 -05:00
Makefile PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver 2017-03-24 10:31:17 -05:00
pci-aardvark.c PCI: aardvark: Move to MSI handling using generic MSI support 2017-03-14 15:06:33 -05:00
pci-ftpci100.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-host-common.c PCI: generic: Call pci_fixup_irqs() only on ARM 2017-02-09 09:13:20 -06:00
pci-host-generic.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-hyperv.c PCI: hv: Convert hv_pci_dev.refs from atomic_t to refcount_t 2017-04-18 09:02:48 -05:00
pci-mvebu.c Merge branch 'pci/msi' into next 2017-04-28 10:34:19 -05:00
pci-rcar-gen2.c PCI: rcar-gen2: Use gen2 fallback compatibility last 2016-12-07 16:56:02 -06:00
pci-tegra.c PCI: tegra: Update PCI config space remap function 2017-04-24 13:53:17 -05:00
pci-thunder-ecam.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-thunder-pem.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-versatile.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pci-xgene-msi.c PCI/MSI: pci-xgene-msi: Fix CPU hotplug registration handling 2017-01-17 08:41:51 -06:00
pci-xgene.c PCI: Don't allow unbinding host controllers that aren't prepared 2017-04-28 10:38:00 -05:00
pcie-altera-msi.c Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-artpec', 'pci/host-designware', 'pci/host-hv', 'pci/host-keystone', 'pci/host-rcar', 'pci/host-rockchip', 'pci/host-tegra' and 'pci/host-xilinx' into next 2016-10-05 13:59:14 -05:00
pcie-altera.c PCI: altera: Fix TLP_CFG_DW0 for TLP write 2017-02-28 15:06:29 -06:00
pcie-iproc-bcma.c PCI: iproc: Save host bridge window resource in struct iproc_pcie 2017-03-09 11:27:07 -06:00
pcie-iproc-msi.c PCI: iproc: Add BCMA type 2016-11-14 15:55:33 -06:00
pcie-iproc-platform.c Merge branch 'pci/ioremap' into next 2017-04-28 10:34:05 -05:00
pcie-iproc.c PCI: iproc: Configure PCIe MPS settings 2017-02-08 15:20:09 -06:00
pcie-iproc.h PCI: iproc: Save host bridge window resource in struct iproc_pcie 2017-03-09 11:27:07 -06:00
pcie-rcar.c PCI: rcar: Use of_device_get_match_data() to simplify probe 2017-01-31 16:35:42 -06:00
pcie-rockchip.c Merge branch 'pci/ioremap' into next 2017-04-28 10:34:05 -05:00
pcie-xilinx-nwl.c PCI: xilinx-nwl: Update PCI config space remap function 2017-04-24 13:53:15 -05:00
pcie-xilinx.c PCI: xilinx: Update PCI config space remap function 2017-04-24 13:53:14 -05:00
vmd.c treewide: Constify most dma_map_ops structures 2017-01-24 12:23:35 -05:00