summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2018-04-06 13:33:55 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-13 13:34:41 -0400
commit78f675d4399ec5b2442f25bd750e99390725f921 (patch)
treea98eedaf32aea1f5bd3ad8f7061fd21739cb944d
parent21769fefa25ac75108b7690cfaa04607f1bdf11e (diff)
downloadtalos-hostboot-78f675d4399ec5b2442f25bd750e99390725f921.tar.gz
talos-hostboot-78f675d4399ec5b2442f25bd750e99390725f921.zip
Improve linking of PLIDs for sbe_retry_handler
Previously if a PLID was passed to the ctor of the sbe_retry_handler we would link all errors logs created during the process of recovering the SBE with this PLID. But if no PLID was passed then we would not link the logs. This commit changes it so if no PLID is passed to the ctor then the first log created in the recovery process will become the PLID that all logs after will be set to. Change-Id: I93ef3a48b4cc1d7df3237d7ba3dfefba21d5fb6b Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56885 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/sbeio/sbe_retry_handler.H43
-rw-r--r--src/usr/sbeio/common/sbe_retry_handler.C95
2 files changed, 67 insertions, 71 deletions
diff --git a/src/include/usr/sbeio/sbe_retry_handler.H b/src/include/usr/sbeio/sbe_retry_handler.H
index deef15c32..747f2fb90 100644
--- a/src/include/usr/sbeio/sbe_retry_handler.H
+++ b/src/include/usr/sbeio/sbe_retry_handler.H
@@ -96,9 +96,9 @@ class SbeRetryHandler
SbeRetryHandler::SBE_REG_RETURN::SBE_AT_RUNTIME);
}
- inline uint32_t getCallerPLID()
+ inline uint32_t getMasterPLID()
{
- return iv_callerErrorLogPLID;
+ return iv_masterErrorLogPLID;
}
inline uint8_t getSwitchCount()
@@ -204,6 +204,30 @@ class SbeRetryHandler
void bestEffortCheck();
/**
+ * @brief It is possible that multiple error logs will get created throughout
+ * the process of trying to recover the SBE. We want all of these logs
+ * to share the same platform log id (PLID). This function will check
+ * if iv_masterErrorLogPLID is non-zero, if it is we will set the PLID
+ * of the error log passed into this function to be iv_masterErrorLogPLID.
+ * If iv_masterErrorLogPLID is zero, we will update iv_masterErrorLogPLID
+ * to be whatever the PLID is of the error log passed to this function
+ *
+ *
+ * @return - void
+ */
+ inline void updatePlids(errlHndl_t & i_errl)
+ {
+ if(iv_masterErrorLogPLID)
+ {
+ i_errl->plid(iv_masterErrorLogPLID);
+ }
+ else
+ {
+ iv_masterErrorLogPLID = i_errl->plid();
+ }
+ }
+
+ /**
* @brief This function handles the SBE timeout and loops
* required to start it.
*
@@ -219,10 +243,6 @@ class SbeRetryHandler
*
* @param[in] i_target - current proc target
*
- * @return - bool for flow control on return to caller, if false,
- * caller should go on with the processing flow, if true,
- * caller should interrupt the processing flow and get out
- * of loop or current iteration
*/
void sbe_get_ffdc_handler(TARGETING::Target * i_target);
@@ -294,12 +314,13 @@ class SbeRetryHandler
bool iv_secureModeDisabled;
/*
- * @brief PLID of the caller. 0 if caller does not
- * provide one. Not to be confused with the
- * PLID when error log is created in the usage
- * of this class.
+ * @brief If the caller of this class sets the PLID in the ctor
+ then the ctor will set that PLID to this instance variable.
+ If the caller does not pass a PLID into the ctor then the
+ first error log created while doing the retry will set this
+ PLID.
*/
- uint32_t iv_callerErrorLogPLID;
+ uint32_t iv_masterErrorLogPLID;
/*
* @brief Number of times we switch SBE sides. Max is defined by
diff --git a/src/usr/sbeio/common/sbe_retry_handler.C b/src/usr/sbeio/common/sbe_retry_handler.C
index 5cfa6f32f..14725e93a 100644
--- a/src/usr/sbeio/common/sbe_retry_handler.C
+++ b/src/usr/sbeio/common/sbe_retry_handler.C
@@ -118,7 +118,7 @@ SbeRetryHandler::SbeRetryHandler(SBE_MODE_OF_OPERATION i_sbeMode,
: iv_useSDB(false)
, iv_secureModeDisabled(false) //Per HW team this should always be 0
-, iv_callerErrorLogPLID(i_plid)
+, iv_masterErrorLogPLID(i_plid)
, iv_switchSidesCount(0)
, iv_currentAction(P9_EXTRACT_SBE_RC::ERROR_RECOVERED)
, iv_currentSBEState(SBE_REG_RETURN::SBE_NOT_AT_RUNTIME)
@@ -286,12 +286,9 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
HWAS::DELAYED_DECONFIG,
HWAS::GARD_NULL );
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
errlCommit(l_errl, ISTEP_COMP_ID);
this->iv_currentSBEState = SBE_REG_RETURN::PROC_DECONFIG;
@@ -328,12 +325,10 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
TARGETING::get_huid(i_target));
l_errl->collectTrace( SBEIO_COMP_NAME, 256);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
+
errlCommit(l_errl, SBEIO_COMP_ID);
// Break out of loop, something bad happened and we dont want end
// up in a endless loop
@@ -378,12 +373,10 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
l_errl->collectTrace( SBEIO_COMP_NAME, 256);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
+
errlCommit(l_errl, SBEIO_COMP_ID);
// Break out of loop, something bad happened and we dont want end
// up in a endless loop
@@ -415,12 +408,9 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
HWAS::NO_DECONFIG,
HWAS::GARD_Predictive);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
errlCommit( l_errl, ISTEP_COMP_ID);
// If we got an errlog while attempting start_cbs
@@ -450,12 +440,9 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
HWAS::NO_DECONFIG,
HWAS::GARD_Predictive);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
errlCommit( l_errl, ISTEP_COMP_ID);
// If we got an errlog while attempting p9_sbe_hreset
@@ -514,12 +501,9 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
l_errl->collectTrace("ISTEPS_TRACE",256);
l_errl->collectTrace(SBEIO_COMP_NAME,256);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
errlCommit(l_errl, ISTEP_COMP_ID);
}
@@ -570,12 +554,9 @@ bool SbeRetryHandler::sbe_run_extract_msg_reg(TARGETING::Target * i_target)
SBE_TRACF("ERROR: call sbe_run_extract_msg_reg, PLID=0x%x", l_errl->plid() );
l_errl->collectTrace(SBEIO_COMP_NAME,256);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
// capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog( l_errl );
@@ -924,12 +905,9 @@ void SbeRetryHandler::sbe_get_ffdc_handler(TARGETING::Target * i_target)
l_errl->collectTrace( SBEIO_COMP_NAME, KILOBYTE/4);
l_errl->collectTrace( "ISTEPS_TRACE", KILOBYTE/4);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
errlCommit(l_errl, ISTEP_COMP_ID);
}
@@ -972,7 +950,7 @@ void SbeRetryHandler::sbe_run_extract_rc(TARGETING::Target * i_target)
l_ret, iv_useSDB, iv_secureModeDisabled);
// Convert the returnCode into an UNRECOVERABLE error log which we will
- // associated w/ the caller's errlog via plid
+ // associate w/ the caller's errlog via plid
l_errl = rcToErrl(l_rc, ERRORLOG::ERRL_SEV_UNRECOVERABLE);
this->iv_currentAction = l_ret;
@@ -1003,12 +981,9 @@ void SbeRetryHandler::sbe_run_extract_rc(TARGETING::Target * i_target)
// Capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog( l_errl );
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (iv_callerErrorLogPLID)
- {
- l_errl->plid(iv_callerErrorLogPLID);
- }
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
// Commit error log
errlCommit( l_errl, HWPF_COMP_ID );
@@ -1227,11 +1202,11 @@ errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target)
this->iv_currentSideBootAttempts = 0;
}while(0);
- // Set the PLID of the error log to caller's PLID,
- // if provided
- if (l_errl && iv_callerErrorLogPLID)
+ if (l_errl)
{
- l_errl->plid(iv_callerErrorLogPLID);
+ // Set the PLID of the error log to master PLID
+ // if the master PLID is set
+ updatePlids(l_errl);
}
SBE_TRACF(EXIT_MRK "switch_sbe_sides()");
OpenPOWER on IntegriCloud