]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: rockchip: Add remove() support
authorBrian Norris <briannorris@chromium.org>
Fri, 10 Mar 2017 02:46:15 +0000 (18:46 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 21 Apr 2017 15:54:35 +0000 (10:54 -0500)
commit0d98a1bfea85297b7f8ad04f0ef43086cc7310ef
treea5d31cfbe63c905a5954096b887e70f631a9a2f7
parenta703d2a9e4e46178e7387ad9bbe0ee76c932753f
PCI: rockchip: Add remove() support

Currently, if we try to unbind the platform device, the remove will
succeed, but the removal won't undo most of the registration, leaving
partially-configured PCI devices in the system.

This allows, for example, a simple 'lspci' to crash the system, as it will
try to touch the freed (via devm_*) driver structures, e.g., on RK3399:

  # echo f8000000.pcie > /sys/bus/platform/drivers/rockchip-pcie/unbind
  # lspci

So let's implement device remove().

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/pci/host/pcie-rockchip.c