Skip to content

Commit

Permalink
sbe_extract_rc_handler finite state machine details (3/4)
Browse files Browse the repository at this point in the history
This commits sets up the specific details for every function
included in the finite state machine.  Basically, it calls
a retry of the SBE if applicable, and then handles the error
or pass for what it needs to do next.  In the end, we either
pass with a working SBE or we fail, gard out the proc and continue.

Change-Id: I298e43e85bfd4f0591aefe289d6792f001fb24b2
RTC:173809
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41075
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
e-liner authored and dcrowell77 committed Jun 28, 2017
1 parent dd4981b commit 6cd010a
Showing 1 changed file with 176 additions and 4 deletions.
180 changes: 176 additions & 4 deletions src/usr/isteps/istep08/sbe_extract_rc_handler.C
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,199 @@ P9_EXTRACT_SBE_RC::RETURN_ACTION same_side_retry_state(
TARGETING::Target * i_target,
uint8_t i_prev_error)
{
errlHndl_t l_errl = NULL;

const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapi2_proc_target (i_target);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Running p9_start_cbs HWP on processor target %.8X",
TARGETING::get_huid(i_target));

FAPI_INVOKE_HWP(l_errl, p9_start_cbs, l_fapi2_proc_target, true);
if(l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR: call p9_start_cbs, "
"PLID=0x%x", l_errl->plid() );
l_errl->collectTrace( "ISTEPS_TRACE", 256);

errlCommit(l_errl, ISTEP_COMP_ID);

// Get SBE extract rc
P9_EXTRACT_SBE_RC::RETURN_ACTION l_rcAction =
P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM;
FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc,
l_fapi2_proc_target, l_rcAction);

if(l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : p9_extract_sbe_rc HWP returning errorlog "
"PLID-0x%x", l_errl->plid());

// capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_errl);

// Commit error log
errlCommit( l_errl, HWPF_COMP_ID );
}

return l_rcAction;
}

return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass
}

P9_EXTRACT_SBE_RC::RETURN_ACTION other_side_state(
TARGETING::Target * i_target,
uint8_t i_prev_error)
{
errlHndl_t l_errl = NULL;

// Get other proc
TARGETING::Target * sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);

TARGETING::PredicateCTM predProc(TARGETING::CLASS_CHIP,
TARGETING::TYPE_PROC);
TARGETING::TargetHandleList l_procs;
TARGETING::targetService().getAssociated(l_procs, sys,
TARGETING::TargetService::CHILD,
TARGETING::TargetService::ALL,&predProc);

for(auto childItr = l_procs.begin();
childItr != l_procs.end(); ++childItr)
{
if( (*childItr) == i_target)
{
continue;
}
else
{
// Run HWP, but from the other side.
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapi2_proc_target(*childItr);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Running p9_start_cbs HWP on processor target %.8X",
TARGETING::get_huid(*childItr));

FAPI_INVOKE_HWP(l_errl, p9_start_cbs, l_fapi2_proc_target, true);
if(l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR: call p9_start_cbs, "
"PLID=0x%x",l_errl->plid() );
l_errl->collectTrace( "ISTEPS_TRACE", 256);

errlCommit(l_errl, ISTEP_COMP_ID);

// Get SBE extract rc
P9_EXTRACT_SBE_RC::RETURN_ACTION l_rcAction =
P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM;
FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc,
l_fapi2_proc_target, l_rcAction);

if(l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : p9_extract_sbe_rc HWP returning errorlog "
"PLID-0x%x", l_errl->plid());

// capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_errl);

// Commit error log
errlCommit( l_errl, HWPF_COMP_ID );
}

return l_rcAction;
}
}
}

return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass
}

P9_EXTRACT_SBE_RC::RETURN_ACTION working_exit_state(
TARGETING::Target * i_target,
uint8_t i_prev_error)
{
errlHndl_t l_errl = NULL;

// If we came from the other side, create info log
// to say we booted on an unexpected side
if(i_prev_error == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM)
{
// Information log
/* @
* @errortype
* @moduleid MOD_SBE_THRESHOLD_FSM
* @reasoncode RC_SBE_BOOTED_UNEXPECTED_SIDE_BKP,
* @userdata1 0
* @userdata2 HUID
* @devdesc The SBE has booted on an unexpected side
*/
l_errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ISTEP::MOD_SBE_THRESHOLD_FSM,
ISTEP::RC_SBE_BOOTED_UNEXPECTED_SIDE_BKP,
0,
get_huid(i_target));

l_errl->collectTrace( "ISTEPS_TRACE", 256);

errlCommit(l_errl, ISTEP_COMP_ID);

}

return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass
}

P9_EXTRACT_SBE_RC::RETURN_ACTION failing_exit_state(
TARGETING::Target * i_target,
uint8_t i_prev_error)
{
errlHndl_t l_errl = NULL;

// Look at current error (1-6)
// Error is 1,2 or 4. Escalate to REIPL_BKP_SEEPROM (recall fcn)
if( (i_prev_error == P9_EXTRACT_SBE_RC::RESTART_SBE) ||
(i_prev_error == P9_EXTRACT_SBE_RC::RESTART_CBS) ||
(i_prev_error == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM) )
{
proc_extract_sbe_handler(i_target, i_prev_error,
P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM);
}
// Error is 3 or 6. Gard and callout proc, return back to 8.4
else if(i_prev_error == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM)
{
// There is no action possible. Gard and Callout the proc
/* @
* @errortype ERRL_SEV_UNRECOVERABLE
* @moduleid MOD_SBE_EXTRACT_RC_HANDLER
* @reasoncode RC_NO_RECOVERY_ACTION
* @userdata1 SBE current error
* @userdata2 HUID of proc
* @devdesc There is no recovery action on the SBE.
* We're garding this proc
*/
l_errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
ISTEP::MOD_SBE_THRESHOLD_FSM,
ISTEP::RC_NO_RECOVERY_ACTION,
i_prev_error,
TARGETING::get_huid(i_target));
l_errl->collectTrace( "ISTEPS_TRACE", 246);
l_errl->addHwCallout( i_target,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::DECONFIG,
HWAS::GARD_Predictive );
errlCommit(l_errl, ISTEP_COMP_ID);

}

// 5 will never happen. If it does, just return back to 8.4

return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass
}
// end FSM
Expand Down Expand Up @@ -284,10 +456,10 @@ void proc_extract_sbe_handler( TARGETING::Target * i_target,
// an unexpected side
// if it fails, call the threshold handler
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapi2_proc_target((*childItr));
l_fapi2_proc_target(*childItr);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Running p9_start_cbs HWP on processor target %.8X",
TARGETING::get_huid((*childItr)));
TARGETING::get_huid(*childItr));

FAPI_INVOKE_HWP(l_errl, p9_start_cbs,
l_fapi2_proc_target, true);
Expand Down Expand Up @@ -382,10 +554,10 @@ void proc_extract_sbe_handler( TARGETING::Target * i_target,
// if it fails, escalate to RE_IPL_SEEPROM and call
// this function again.
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapi2_proc_target((*childItr));
l_fapi2_proc_target(*childItr);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Running p9_start_cbs HWP on processor target %.8X",
TARGETING::get_huid((*childItr)));
TARGETING::get_huid(*childItr));

FAPI_INVOKE_HWP(l_errl, p9_start_cbs,
l_fapi2_proc_target, true);
Expand Down

0 comments on commit 6cd010a

Please sign in to comment.