From: Gavin Shan <shangw@linux.vnet.ibm.com>
Date: Wed, 24 Jul 2013 02:24:53 +0000 (+0800)
Subject: powerpc/pci: Override pcibios_release_device()
X-Git-Tag: firefly_0821_release~176^2~5607^2~18
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=008a4938ea07db071f03adffaa3a78c2fbbcde6b;p=firefly-linux-kernel-4.4.55.git

powerpc/pci: Override pcibios_release_device()

The patch overrides pcibios_release_device() to release EEH
resources (EEH cache, unbinding EEH device) for the indicated PCI
device.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 3f608800c06b..3dab2f2801b9 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -21,6 +21,17 @@
 #include <asm/firmware.h>
 #include <asm/eeh.h>
 
+/**
+ * pcibios_release_device - release PCI device
+ * @dev: PCI device
+ *
+ * The function is called before releasing the indicated PCI device.
+ */
+void pcibios_release_device(struct pci_dev *dev)
+{
+	eeh_remove_device(dev, 1);
+}
+
 /**
  * __pcibios_remove_pci_devices - remove all devices under this bus
  * @bus: the indicated PCI bus