aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-12 01:44:18 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-12 17:38:25 -0400
commit3a0e40beefc20852191ed65d53e1b82d95ac11b8 (patch)
tree88016bbede6794b6635d86e19c1cd09b56e295e4
parentd65eba6a7a769bb939303969267cbf1c916358f5 (diff)
PCI: acpiphp: Remove all functions even if function 0 doesn't exist
Currently function disable_device() detects slot state by checking existence of PCI function 0. It's unreliable because the PCI device for function 0 may be removed through the sysfs interface. If that happens, it will cause powering off a hotplug slot without destroying all PCI devices. On the other hand, it won't hurt us except wasting some computation power if the check is removed, because all code of disable_device() is self-protected. So remove the check. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Yinghai Lu <yinghai@kernel.org> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Toshi Kani <toshi.kani@hp.com>
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 7948bc919605..a1c8dd67aae1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -914,13 +914,6 @@ static int disable_device(struct acpiphp_slot *slot)
914 struct pci_dev *pdev; 914 struct pci_dev *pdev;
915 struct pci_bus *bus = slot->bridge->pci_bus; 915 struct pci_bus *bus = slot->bridge->pci_bus;
916 916
917 /* The slot will be enabled when func 0 is added, so check
918 func 0 before disable the slot. */
919 pdev = pci_get_slot(bus, PCI_DEVFN(slot->device, 0));
920 if (!pdev)
921 goto err_exit;
922 pci_dev_put(pdev);
923
924 list_for_each_entry(func, &slot->funcs, sibling) { 917 list_for_each_entry(func, &slot->funcs, sibling) {
925 if (func->bridge) { 918 if (func->bridge) {
926 /* cleanup p2p bridges under this P2P bridge */ 919 /* cleanup p2p bridges under this P2P bridge */