[Skiboot] [PATCH] fsp: Bail out of HIR if FSP is resetting voluntarily

Ananth N Mavinakayanahalli ananth at linux.vnet.ibm.com
Thu Nov 30 20:32:18 AEDT 2017


a. Surveillance response times out and OPAL triggers a HIR
b. Before the HIR process kicks in, OPAL gets a PSI interrupt indicating link down
c. HIR process continues and OPAL tries to write to DRCR; PSI link inactive => xstop

OPAL should confirm that the FSP is not already in reset in the HIR path.

Signed-off-by: Ananth N Mavinakayanahalli <ananth at linux.vnet.ibm.com>
Tested-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
---
 hw/fsp/fsp.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 4d173978..174fcfae 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -459,7 +459,16 @@ static bool fsp_crit_op_in_progress(struct fsp *fsp)
 /* Notify the FSP that it will be reset soon by writing to the DRCR */
 static void fsp_prep_for_reset(struct fsp *fsp)
 {
-	u32 drcr = fsp_rreg(fsp, FSP_DRCR_REG);
+	u32 drcr;
+
+	/*
+	 * Its possible that the FSP went into reset by itself between the
+	 * time the HIR is triggered and we get here. Check and bail out if so.
+	 */
+	if (fsp_in_rr())
+		return;
+
+	drcr = fsp_rreg(fsp, FSP_DRCR_REG);
 
 	prlog(PR_TRACE, "FSP: Writing reset to DRCR\n");
 	drcr_last_print = drcr;
@@ -472,6 +481,9 @@ static void fsp_hir_poll(struct fsp *fsp, struct psi *psi)
 {
 	u32 drcr;
 
+	if (fsp_in_reset(fsp) || !(psi_check_link_active(psi)))
+		return;
+
 	switch (fsp->state) {
 	case fsp_mbx_crit_op:
 		if (fsp_crit_op_in_progress(fsp)) {



More information about the Skiboot mailing list