Patchwork [3/8] powerpc/pci: Override pcibios_stop_dev()

login
register
mail settings
Submitter Gavin Shan
Date July 5, 2013, 2:57 a.m.
Message ID <1372993054-25730-4-git-send-email-shangw@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/257034/
State Superseded
Headers show

Comments

Gavin Shan - July 5, 2013, 2:57 a.m.
The patch overrides the weak function pcibios_stop_dev() to destroy
the EEH device and cache while stopping and removing the corresponding
PCI device.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/pci-hotplug.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 3f60880..617d2df 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -22,6 +22,18 @@ 
 #include <asm/eeh.h>
 
 /**
+ * pcibios_stop_dev - stop the PCI device
+ * @dev: the indicated PCI device
+ *
+ * Stop the PCI device. The function should be called before
+ * stopping the specified PCI device.
+ */
+void pcibios_stop_dev(struct pci_dev *dev)
+{
+	eeh_remove_device(dev, 1);
+}
+
+/**
  * __pcibios_remove_pci_devices - remove all devices under this bus
  * @bus: the indicated PCI bus
  * @purge_pe: destroy the PE on removal of PCI devices
@@ -45,7 +57,6 @@  void __pcibios_remove_pci_devices(struct pci_bus *bus, int purge_pe)
 		 pci_domain_nr(bus),  bus->number);
 	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
 		pr_debug("     * Removing %s...\n", pci_name(dev));
-		eeh_remove_bus_device(dev, purge_pe);
 		pci_stop_and_remove_bus_device(dev);
 	}
 }