[Skiboot] [PATCH] capi: Perform capp recovery sequence only when PBCQ is idle

Vaibhav Jain vaibhav at linux.vnet.ibm.com
Thu Jan 18 17:06:28 AEDT 2018


Presently during a CRESET the CAPP recovery sequence can be executed
multiple times in case PBCQ on the PEC is still busy processing in/out
bound inflight transactions.

This patch updates phb4_creset() to perform capp-recovery sequence via
do_capp_recovery_scoms() only when PBCQ General Status Register
reports no pending transactions.

Signed-off-by: Vaibhav Jain <vaibhav at linux.vnet.ibm.com>
---
 hw/phb4.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index 8e660b66..93ed1e06 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2899,15 +2899,16 @@ static int64_t phb4_creset(struct pci_slot *slot)
 		slot->retries = 500;
 		return pci_slot_set_sm_timeout(slot, msecs_to_tb(10));
 	case PHB4_SLOT_CRESET_WAIT_CQ:
-		/* capp recovery */
-		if (p->flags & PHB4_CAPP_RECOVERY)
-			do_capp_recovery_scoms(p);
 
 		// Wait until operations are complete
 		xscom_read(p->chip_id, p->pe_stk_xscom + 0xc, &pbcq_status);
 		if (!(pbcq_status & 0xC000000000000000)) {
 			PHBDBG(p, "CRESET: No pending transactions\n");
 
+			/* capp recovery */
+			if (p->flags & PHB4_CAPP_RECOVERY)
+				do_capp_recovery_scoms(p);
+
 			/* Clear errors in PFIR and NFIR */
 			xscom_write(p->chip_id, p->pci_stk_xscom + 0x1,
 				    ~p->pfir_cache);
-- 
2.14.3



More information about the Skiboot mailing list