acpiphp: stop bus device before acpi_bus_trim
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Tue, 12 Sep 2006 17:17:46 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 27 Sep 2006 00:43:54 +0000 (17:43 -0700)
Contrary to PCI bridge hot-add, we need to follow the sequence below
for PCI bridge hot-removal.

  (1) Stop devices (detach drivers, remove from the global list, etc.)
  (2) Unbind ACPI node from the devices (remove the _PRT entries)
  (3) Remove devices (remove from the device list, etc.)

This patch fixes acpiphp driver to follow above sequence for P2P
bridge hot-removal.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/acpiphp_glue.c

index c1001ad81ad48f86379bf126afa3143126638b1c..d36732cd4bad0b1bcbb88227806ce5179a799aff 100644 (file)
@@ -1129,6 +1129,9 @@ static int disable_device(struct acpiphp_slot *slot)
                        func->bridge = NULL;
                }
 
+               if (func->pci_dev)
+                       pci_stop_bus_device(func->pci_dev);
+
                acpiphp_bus_trim(func->handle);
                /* try to remove anyway.
                 * acpiphp_bus_add might have been failed */