[Skiboot] [PATCH 09/16] phb4: Fix order of pfir/nfir clearing in CRESET

Michael Neuling mikey at neuling.org
Wed Jul 12 12:06:48 AEST 2017


According to the workbook, pfir must be cleared before the nfir.
The way we have it now causes the nfir to not clear properly in some
error circumstances.

This swaps the order to match the workbook.

Also updates the comments to be clearer.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/phb4.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index 088ca9643e..c54d3cd4c8 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2420,7 +2420,7 @@ static int64_t phb4_creset(struct pci_slot *slot)
 		xscom_write(p->chip_id, p->pci_stk_xscom + XPEC_PCI_STK_ETU_RESET,
 			    0x8000000000000000);
 
-		/* Clear errors in PFIR and NFIR */
+		/* Read errors in PFIR and NFIR */
 		xscom_read(p->chip_id, p->pci_stk_xscom + 0x0, &p->pfir_cache);
 		xscom_read(p->chip_id, p->pe_stk_xscom + 0x0, &p->nfir_cache);
 
@@ -2433,10 +2433,11 @@ static int64_t phb4_creset(struct pci_slot *slot)
 		if (!(pbcq_status & 0xC000000000000000)) {
 			PHBDBG(p, "CRESET: No pending transactions\n");
 
-			xscom_write(p->chip_id, p->pe_stk_xscom + 0x1,
-				    ~p->nfir_cache);
+			/* Clear errors in PFIR and NFIR */
 			xscom_write(p->chip_id, p->pci_stk_xscom + 0x1,
 				    ~p->pfir_cache);
+			xscom_write(p->chip_id, p->pe_stk_xscom + 0x1,
+				    ~p->nfir_cache);
 
 			/* Clear PHB from reset */
 			xscom_write(p->chip_id,
-- 
2.11.0



More information about the Skiboot mailing list