PCI/powerpc: support PCIe fundamental reset

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, September 16, 2009 - 7:59 am

Gitweb:     http://git.kernel.org/linus/6e19314cc98ab9ccc22c30d1c414984ac6de5ce2
Commit:     6e19314cc98ab9ccc22c30d1c414984ac6de5ce2
Parent:     fe14acd4e7c8178dfb172c1e7a88356657378128
Author:     Mike Mason <mmlnx@us.ibm.com>
AuthorDate: Thu Jul 30 15:42:39 2009 -0700
Committer:  Jesse Barnes <jbarnes@virtuousgeek.org>
CommitDate: Wed Sep 9 13:29:41 2009 -0700

    PCI/powerpc: support PCIe fundamental reset
    
    By default, the EEH framework on powerpc does what's known as a "hot
    reset" during recovery of a PCI Express device.  We've found a case
    where the device needs a "fundamental reset" to recover properly.  The
    current PCI error recovery and EEH frameworks do not support this
    distinction.
    
    The attached patch makes changes to EEH to utilize the new bit field.
    
    Signed-off-by: Mike Mason <mmlnx@us.ibm.com>
    Signed-off-by: Richard Lary <rlary@us.ibm.com>
    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 arch/powerpc/kernel/pci_64.c         |    1 +
 arch/powerpc/platforms/pseries/eeh.c |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 9e8902f..b6e9ea4 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -143,6 +143,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 	dev->dev.bus = &pci_bus_type;
 	dev->devfn = devfn;
 	dev->multifunction = 0;		/* maybe a lie? */
+	dev->needs_freset = 0;       /* pcie fundamental reset required */
 
 	dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
 	dev->device = get_int_prop(node, "device-id", 0xffff);
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 989d646..ccd8dd0 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -744,7 +744,15 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
 
 static void __rtas_set_slot_reset(struct pci_dn *pdn)
 {
-	rtas_pci_slot_reset (pdn, 1);
+	struct pci_dev *dev = pdn->pcidev;
+
+	/* Determine type of EEH reset required by device,
+	 * default hot reset or fundamental reset
+	 */
+	if (dev->needs_freset)
+		rtas_pci_slot_reset(pdn, 3);
+	else
+		rtas_pci_slot_reset(pdn, 1);
 
 	/* The PCI bus requires that the reset be held high for at least
 	 * a 100 milliseconds. We wait a bit longer 'just in case'.  */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
PCI/powerpc: support PCIe fundamental reset, Linux Kernel Mailing ..., (Wed Sep 16, 7:59 am)