Thread (1 message) 1 message, 1 author, 2015-08-06
DORMANTno replies

[PATCH v6 28/42] powerpc/powernv: Fundamental reset in pnv_pci_reset_secondary_bus()

From: Gavin Shan <hidden>
Date: 2015-08-06 04:11:33
Also in: linux-devicetree, linux-pci
Subsystem: linux for powerpc (32-bit and 64-bit), pci enhanced error handling (eeh) for powerpc, the rest · Maintainers: Madhavan Srinivasan, Mahesh J Salgaonkar, Linus Torvalds

Some subordinate PCI devices of one particular PCI bus might ask
for fundamental reset because the default (hot) reset isn't enough
for those PCI devices to be up successfully after reset.

This iterates all PCI devices behind the specified PCI bus and issues
fundamental reset if any one PCI device is asking for that. Otherwise,
hot reset is still issued.

Signed-off-by: Gavin Shan <redacted>
---
 arch/powerpc/platforms/powernv/eeh-powernv.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 19cb947..4ae48ff 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -1057,8 +1057,31 @@ static int pnv_eeh_vf_pe_reset(struct eeh_pe *pe, int option)
 	return 0;
 }
 
+static int pnv_pci_dev_reset_type(struct pci_dev *pdev, void *data)
+{
+	int *freset = data;
+
+	/*
+	 * Stop the iteration immediately if there is any
+	 * one PCI device requesting fundamental reset
+	 */
+	*freset |= pdev->needs_freset;
+	return *freset;
+}
+
 void pnv_pci_reset_secondary_bus(struct pci_dev *dev)
 {
+	int option = EEH_RESET_HOT;
+
+	if (dev->subordinate) {
+		int freset = 0;
+
+		pci_walk_bus(dev->subordinate,
+			     pnv_pci_dev_reset_type,
+			     &freset);
+		option = freset ? EEH_RESET_FUNDAMENTAL : EEH_RESET_HOT;
+	}
+
 	pnv_eeh_bridge_reset(dev, EEH_RESET_HOT);
 	pnv_eeh_bridge_reset(dev, EEH_RESET_DEACTIVATE);
 }
-- 
2.1.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help