[Skiboot] [PATCH 10/14] phb4: Clear errors before deasserting reset

Michael Neuling mikey at neuling.org
Wed Jul 26 20:50:09 AEST 2017


During reset we may have logged some errors (eg. due to the link going
down).

Hence before we deassert PERST or Hot Reset, we need to clear these
errors. This ensures that once link training starts, only new errors
are logged.

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

diff --git a/hw/phb4.c b/hw/phb4.c
index f17a5eb483..d3b68cf1fb 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2494,6 +2494,9 @@ static int64_t phb4_hreset(struct pci_slot *slot)
 	case PHB4_SLOT_HRESET_DELAY:
 		PHBDBG(p, "HRESET: Deassert\n");
 
+		/* Clear link errors before we deassert reset */
+		phb4_err_clear_regb(p);
+
 		phb4_pcicfg_read16(&p->phb, 0, PCI_CFG_BRCTL, &brctl);
 		brctl &= ~PCI_CFG_BRCTL_SECONDARY_RESET;
 		phb4_pcicfg_write16(&p->phb, 0, PCI_CFG_BRCTL, brctl);
@@ -2558,6 +2561,9 @@ static int64_t phb4_freset(struct pci_slot *slot)
 		p->skip_perst = false;
 		/* fall through */
 	case PHB4_SLOT_FRESET_ASSERT_DELAY:
+		/* Clear link errors before we deassert PERST */
+		phb4_err_clear_regb(p);
+
 		PHBDBG(p, "FRESET: Deassert\n");
 		reg = in_be64(p->regs + PHB_PCIE_CRESET);
 		reg |= PHB_PCIE_CRESET_PERST_N;
-- 
2.11.0



More information about the Skiboot mailing list