diff options
author | Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> | 2017-11-30 17:49:42 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-06 02:36:13 -0600 |
commit | bd64f85b85814986af64b2f62849496d93beecc2 (patch) | |
tree | 484fe21ec9f98ec0ac3e1084e75b955b529bc1a7 | |
parent | 0562b64e55b0e0780064823155f45b1ddf0893a6 (diff) | |
download | blackbird-skiboot-bd64f85b85814986af64b2f62849496d93beecc2.tar.gz blackbird-skiboot-bd64f85b85814986af64b2f62849496d93beecc2.zip |
fsp: Bail out of HIR if FSP is resetting voluntarily
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.
[V2] Handle the case where a second reset is triggered due to the two resets
happening in succession.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Tested-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/fsp/fsp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c index 1179283c..613108c9 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)) { @@ -1588,15 +1600,15 @@ static void __fsp_poll(bool interrupt) } iop = &fsp->iopath[fsp->active_iopath]; + /* Check for error state and handle R&R completion */ + fsp_handle_errors(fsp); + /* Handle host initiated resets */ if (fsp_in_hir(fsp)) { fsp_hir_poll(fsp, iop->psi); return; } - /* Check for error state and handle R&R completion */ - fsp_handle_errors(fsp); - /* * The above might have triggered and R&R, check that we * are still functional |