diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C | 43 | ||||
-rw-r--r-- | src/usr/sbeio/makefile | 1 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_retry_handler.C | 540 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_threshold_fsm.C | 288 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_threshold_fsm.H | 109 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/attribute_types.xml | 14 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 1 |
7 files changed, 218 insertions, 778 deletions
diff --git a/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C b/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C index 502db189a..cd180281b 100644 --- a/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C +++ b/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C @@ -124,54 +124,17 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget( const_cast<TARGETING::Target*> (l_cpu_target)); - sbeMsgReg_t l_sbeReg; - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Running p9_get_sbe_msg_register HWP" " on processor target %.8X", TARGETING::get_huid(l_cpu_target)); - SBEIO::SbeRetryHandler::SBE_REG_RETURN l_ret = - SBEIO::SbeRetryHandler::SBE_REG_RETURN::SBE_FAILED_TO_BOOT; - - l_errl = SBEIO::SbeRetryHandler::getInstance().sbe_timeout_handler( - &l_sbeReg,l_cpu_target,&l_ret); - - if((!l_errl) && (l_sbeReg.currState != SBE_STATE_RUNTIME)) - { - // See if async FFDC bit is set in SBE register - if(l_sbeReg.asyncFFDC) - { - bool l_flowCtrl = SBEIO::SbeRetryHandler::getInstance(). - sbe_get_ffdc_handler(l_cpu_target); - - if(l_flowCtrl) - { - continue; - } - } - - // Handle that SBE failed to boot in the allowed time - SBEIO::SbeRetryHandler::getInstance().sbe_boot_fail_handler( - l_cpu_target,l_sbeReg); - } - else if (l_errl) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR : call p9_check_slave_sbe_seeprom_complete, " - "PLID=0x%x", l_errl->plid() ); - - // capture the target data in the elog - ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); + SBEIO::SbeRetryHandler l_SBEobj = SBEIO::SbeRetryHandler(); - // Create IStep error log and cross reference to error - l_stepError.addErrorDetails( l_errl ); + l_SBEobj.main_sbe_handler(l_cpu_target,false); - // Commit error log - errlCommit( l_errl, HWPF_COMP_ID ); - } // No error and still functional - else if(l_cpu_target->getAttr<ATTR_HWAS_STATE>().functional) + if(l_cpu_target->getAttr<ATTR_HWAS_STATE>().functional) { // Set attribute indicating that SBE is started l_cpu_target->setAttr<ATTR_SBE_IS_STARTED>(1); diff --git a/src/usr/sbeio/makefile b/src/usr/sbeio/makefile index c13f1e4af..f381363cb 100644 --- a/src/usr/sbeio/makefile +++ b/src/usr/sbeio/makefile @@ -55,7 +55,6 @@ OBJS += sbe_memRegionMgr.o OBJS += sbe_fifo_buffer.o OBJS += sbe_ffdc_package_parser.o OBJS += sbe_attn.o -OBJS += sbe_threshold_fsm.o OBJS += sbe_retry_handler.o VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/ diff --git a/src/usr/sbeio/sbe_retry_handler.C b/src/usr/sbeio/sbe_retry_handler.C index 8b334f0c1..24b9c3e6c 100644 --- a/src/usr/sbeio/sbe_retry_handler.C +++ b/src/usr/sbeio/sbe_retry_handler.C @@ -58,13 +58,10 @@ #include <../../usr/sbeio/sbe_fifo_buffer.H> #include <sbeio/sbe_ffdc_parser.H> #include <sbeio/sbeioreasoncodes.H> -#include "sbe_threshold_fsm.H" +#include <sbeio/sbe_retry_handler.H> #include <devicefw/driverif.H> -/* Global switch sides count */ -static uint8_t g_switch_sides_count = 0; - extern trace_desc_t* g_trac_sbeio; #define SBE_TRACF(printf_string,args...) \ @@ -77,6 +74,8 @@ extern trace_desc_t* g_trac_sbeio; #define SBE_TRACDBIN(printf_string,args...) \ TRACDBIN(g_trac_sbeio,"sbe_retry_handler.C: " printf_string,##args) +using namespace ERRORLOG; + namespace SBEIO { @@ -90,8 +89,11 @@ SbeRetryHandler& SbeRetryHandler::getInstance() SbeRetryHandler::SbeRetryHandler() : iv_sbeRestarted(false) -, iv_sbeOtherSide(false) +, iv_sbeSide(0) , iv_sbeErrorLogged(false) +, iv_switchSidesCount(0) +, iv_currentSBEState(SBE_REG_RETURN::SBE_FAILED_TO_BOOT) +, iv_retriggeredMain(false) { SBE_TRACF(ENTER_MRK "SbeRetryHandler::SbeRetryHandler()"); @@ -103,244 +105,183 @@ SbeRetryHandler::~SbeRetryHandler() } -void SbeRetryHandler::proc_extract_sbe_handler( TARGETING::Target * i_target, - uint8_t i_current_error, - SBE_REG_RETURN * o_regReturn) +void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target, + bool i_actionSet) { - SBE_TRACF(ENTER_MRK "proc_extract_sbe_handler error: %x", - i_current_error); + SBE_TRACF(ENTER_MRK "main_sbe_handler()"); - errlHndl_t l_errl = NULL; + do + { + errlHndl_t l_errl = NULL; - /*@ - * @errortype - * @severity ERRORLOG::ERRL_SEV_INFORMATIONAL - * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_EXTRACT_RC_ERROR - * @userdata1 HUID of proc that had the SBE timeout - * @userdata2 SBE failing code - * - * @devdesc SBE did not start, this function is looking at - * the error to determine next course of action - * - * @custdesc The SBE did not start, we will attempt a reboot if possible - */ - l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - SBEIO_EXTRACT_RC_HANDLER, - SBEIO_EXTRACT_RC_ERROR, - TARGETING::get_huid(i_target), - i_current_error); + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget( + const_cast<TARGETING::Target*> (i_target)); - l_errl->collectTrace("ISTEPS_TRACE",256); + bool l_retry = false; - // Commit error and continue - errlCommit(l_errl, ISTEP_COMP_ID); + // Check the sbe register + this->get_sbe_reg(i_target); - switch(i_current_error) - { - case P9_EXTRACT_SBE_RC::RESTART_SBE: - case P9_EXTRACT_SBE_RC::RESTART_CBS: + if( (this->iv_sbeRegister.currState != SBE_STATE_RUNTIME) && + !(i_actionSet)) { - SBE_TRACF("proc_extract_sbe_handler(): case RESTART_SBE"); - // Note: These two are only going to have the same handling until - // we have runtime handling in place. - - SBE_TRACF("Running p9_start_cbs HWP on processor target %.8X", - TARGETING::get_huid(i_target)); - this->handle_sbe_restart(i_target, false, - P9_EXTRACT_SBE_RC::RESTART_SBE); - break; + // return, false if no boot is needed, true if boot is needed. + l_retry = this->sbe_boot_fail_handler(i_target); + } + else if(i_actionSet) + { + l_retry = true; } - case P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM: + + while((this->iv_sbeRegister.currState != SBE_STATE_RUNTIME) && l_retry) { - SBE_TRACF("proc_extract_sbe_handler(): case REIPL_BKP_SEEPROM"); - // Log additional error on proc. + + SBE_TRACF("main_sbe_handler(): current SBE state is %d, retry is %d " + "current SBE action is %d", + this->iv_sbeRegister.currState, + l_retry, this->iv_currentAction); + /*@ - * @errortype ERRL_SEV_INFORMATIONAL + * @errortype + * @severity ERRORLOG::ERRL_SEV_INFORMATIONAL * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_BOOT_FROM_BKP_SEEPROM - * @userdata1 SBE return code - * @userdata2 HUID current side - * @devdesc Attempting to boot from backup SEEPROM + * @reasoncode SBEIO_EXTRACT_RC_ERROR + * @userdata1 HUID of proc that had the SBE timeout + * @userdata2 SBE failing code + * + * @devdesc SBE did not start, this function is looking at + * the error to determine next course of action + * + * @custdesc The SBE did not start, we will attempt a reboot + * if possible */ l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - SBEIO_EXTRACT_RC_HANDLER, - SBEIO_BOOT_FROM_BKP_SEEPROM, - i_current_error, - get_huid(i_target)); - l_errl->collectTrace("ISTEPS_TRACE",256); - errlCommit(l_errl, ISTEP_COMP_ID); + ERRORLOG::ERRL_SEV_INFORMATIONAL, + SBEIO_EXTRACT_RC_HANDLER, + SBEIO_EXTRACT_RC_ERROR, + TARGETING::get_huid(i_target), + this->iv_currentAction); - l_errl = this->switch_sbe_sides(i_target); - if(l_errl) - { - errlCommit(l_errl,ISTEP_COMP_ID); - break; - } - - // Run HWP, but from the other side. - // if it passes make a note that we booted from - // an unexpected side - // if it fails, call the threshold handler - SBE_TRACF( "Running p9_start_cbs HWP on processor target %.8X", - TARGETING::get_huid(i_target)); + l_errl->collectTrace("ISTEPS_TRACE",256); - this->handle_sbe_restart(i_target, false, - P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM); + // Commit error and continue + errlCommit(l_errl, ISTEP_COMP_ID); - if(i_target->getAttr<TARGETING::ATTR_SBE_IS_STARTED>()) + // if no recovery action, fail out. + if(this->iv_currentAction == P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION) { - // Make a note that we booted from an unexpected side + // There is no action possible. Gard and Callout the proc /*@ - * @errortype ERRL_SEV_INFORMATIONAL - * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_BOOTED_UNEXPECTED_SIDE_BKP - * @userdata1 0 - * @userdata2 HUID of working proc - * @devdesc SBE booted from unexpected side. + * @errortype ERRL_SEV_UNRECOVERABLE + * @moduleid SBEIO_EXTRACT_RC_HANDLER + * @reasoncode SBEIO_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_INFORMATIONAL, + ERRORLOG::ERRL_SEV_UNRECOVERABLE, SBEIO_EXTRACT_RC_HANDLER, - SBEIO_BOOTED_UNEXPECTED_SIDE_BKP, - 0,TARGETING::get_huid(i_target)); - l_errl->collectTrace("ISTEPS_TRACE",256); + SBEIO_NO_RECOVERY_ACTION, + P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION, + TARGETING::get_huid(i_target)); + l_errl->collectTrace( "ISTEPS_TRACE", 256); + l_errl->addHwCallout( i_target, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::DECONFIG, + HWAS::GARD_NULL ); errlCommit(l_errl, ISTEP_COMP_ID); - } - break; - } - case P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM: - { - SBE_TRACF("proc_extract_sbe_handler(): case REIPL_UPD_SEEPROM"); + SBE_TRACF("main_sbe_handler(): updating return value " + "to indicate that we have deconfigured the proc"); + this->iv_currentSBEState = SBE_REG_RETURN::PROC_DECONFIG; + this->iv_sbeErrorLogged = true; + this->iv_errorLogPLID = l_errl->plid(); - l_errl = this->switch_sbe_sides(i_target); - if(l_errl) - { - errlCommit(l_errl,ISTEP_COMP_ID); break; } - // Run HWP, but from the other side. - // if it passes make a note that we booted from an - // unexpected side - // if it fails, escalate to RE_IPL_SEEPROM and call - // this function again. - SBE_TRACF( "Running p9_start_cbs HWP on processor target %.8X", - TARGETING::get_huid(i_target)); + // if the bkp_seeprom or upd_seeprom, attempt to switch sides. + // This is also dependent on the iv_switchSideCount. + if(this->iv_currentAction == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM || + this->iv_currentAction == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM) + { + l_errl = this->switch_sbe_sides(i_target); + if(l_errl) + { + errlCommit(l_errl, ISTEP_COMP_ID); + break; + } + } - this->handle_sbe_restart(i_target, false, - P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM); + SBE_TRACF("Invoking p9_start_cbs HWP"); + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + l_fapi2_proc_target (i_target); - if(i_target->getAttr<TARGETING::ATTR_SBE_IS_STARTED>()) + FAPI_INVOKE_HWP(l_errl, p9_start_cbs, l_fapi2_proc_target, true); + if(l_errl) { - // Make a note that we booted from an unexpected side - /*@ - * @errortype ERRL_SEV_INFORMATIONAL - * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_BOOTED_UNEXPECTED_SIDE_UPD - * @userdata1 0 - * @userdata2 HUID of proc - * @devdesc SBE booted from unexpected side. - */ - l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - SBEIO_EXTRACT_RC_HANDLER, - SBEIO_BOOTED_UNEXPECTED_SIDE_UPD, - 0,TARGETING::get_huid(i_target)); - l_errl->collectTrace("ISTEPS_TRACE",256); - errlCommit(l_errl, ISTEP_COMP_ID); + SBE_TRACF("ERROR: call p9_start_cbs, PLID=0x%x", l_errl->plid() ); + l_errl->collectTrace( "ISTEPS_TRACE", 256 ); + + errlCommit( l_errl, ISTEP_COMP_ID); } - break; - } - case P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION: - { - SBE_TRACF("proc_extract_sbe_handler(): case NO_RECOVERY_ACTION"); - // There is no action possible. Gard and Callout the proc - /*@ - * @errortype ERRL_SEV_UNRECOVERABLE - * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_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, - SBEIO_EXTRACT_RC_HANDLER, - SBEIO_NO_RECOVERY_ACTION, - P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION, - TARGETING::get_huid(i_target)); - l_errl->collectTrace( "ISTEPS_TRACE", 256); - l_errl->addHwCallout( i_target, - HWAS::SRCI_PRIORITY_HIGH, - HWAS::DECONFIG, - HWAS::GARD_NULL ); - errlCommit(l_errl, ISTEP_COMP_ID); + // Get the sbe register + this->get_sbe_reg(i_target); - // Set register return to indicate Gard and Callout of proc - if(o_regReturn) + if( (this->iv_sbeRegister.currState != SBE_STATE_RUNTIME)) { - SBE_TRACF("proc_extract_sbe_handler(): updating return value " - "to indicate that we have deconfigured the proc"); - *o_regReturn = SBE_REG_RETURN::PROC_DECONFIG; + // return, false if no boot is needed, true if boot is needed. + l_retry = this->sbe_boot_fail_handler(i_target); } - - break; } - default: + + this->handle_sbe_reg_value(i_target); + + // if we have started the sbe, and the current action is upd_seeprom + // or bkp_seeprom, note that we started on an unexpected side + if(i_target->getAttr<TARGETING::ATTR_SBE_IS_STARTED>() && + (this->iv_currentAction == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM || + this->iv_currentAction == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM) ) { - //Error out, unexpected enum value returned. /*@ * @errortype ERRL_SEV_INFORMATIONAL * @moduleid SBEIO_EXTRACT_RC_HANDLER - * @reasoncode SBEIO_INCORRECT_FCN_CALL - * @userdata1 SBE current error - * @userdata2 HUID of proc - * @devdesc This function was called incorrectly or - * there is a new enum that is not handled yet. + * @reasoncode SBEIO_BOOTED_UNEXPECTED_SIDE + * @userdata1 0 + * @userdata2 HUID of working proc + * @devdesc SBE booted from unexpected side. */ l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - SBEIO_EXTRACT_RC_HANDLER, - SBEIO_INCORRECT_FCN_CALL, - i_current_error, - TARGETING::get_huid(i_target)); - l_errl->collectTrace( "ISTEPS_TRACE",256); + ERRORLOG::ERRL_SEV_INFORMATIONAL, + SBEIO_EXTRACT_RC_HANDLER, + SBEIO_BOOTED_UNEXPECTED_SIDE, + 0,TARGETING::get_huid(i_target)); + l_errl->collectTrace("ISTEPS_TRACE",256); errlCommit(l_errl, ISTEP_COMP_ID); - - break; } - } - SBE_TRACF(EXIT_MRK "proc_extract_sbe_handler"); + }while(0); - return; + SBE_TRACF(EXIT_MRK "main_sbe_handler()"); } -SbeRetryHandler::SBE_REG_RETURN SbeRetryHandler::check_sbe_reg( - TARGETING::Target * i_target) +void SbeRetryHandler::get_sbe_reg(TARGETING::Target * i_target) { - SBE_TRACF(ENTER_MRK "check_sbe_reg"); + SBE_TRACF(ENTER_MRK "get_sbe_reg()"); errlHndl_t l_errl = nullptr; - SbeRetryHandler::SBE_REG_RETURN l_ret = - SbeRetryHandler::SBE_REG_RETURN::SBE_FAILED_TO_BOOT; do { - sbeMsgReg_t l_sbeReg; - - l_errl = this->sbe_timeout_handler(&l_sbeReg,i_target,&l_ret); + l_errl = this->sbe_timeout_handler(i_target); - if((!l_errl) && (l_sbeReg.currState != SBE_STATE_RUNTIME)) + if((!l_errl) && (this->iv_sbeRegister.currState != SBE_STATE_RUNTIME)) { // See if async FFDC bit is set in SBE register - if(l_sbeReg.asyncFFDC) + if(this->iv_sbeRegister.asyncFFDC) { bool l_flowCtrl = this->sbe_get_ffdc_handler(i_target); @@ -349,13 +290,10 @@ SbeRetryHandler::SBE_REG_RETURN SbeRetryHandler::check_sbe_reg( break; } } - - // Handle that SBE failed to boot in the allowed time - this->sbe_boot_fail_handler(i_target,l_sbeReg,&l_ret); } else if (l_errl) { - SBE_TRACF("ERROR: call check_sbe_reg, PLID=0x%x", l_errl->plid() ); + SBE_TRACF("ERROR: call get_sbe_reg, PLID=0x%x", l_errl->plid() ); // capture the target data in the elog ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog( l_errl ); @@ -368,57 +306,53 @@ SbeRetryHandler::SBE_REG_RETURN SbeRetryHandler::check_sbe_reg( { // Set attribute indicating that SBE is started i_target->setAttr<TARGETING::ATTR_SBE_IS_STARTED>(1); + this->iv_sbeRestarted = true; - SBE_TRACF("SUCCESS: check_sbe_reg completed okay for proc 0x%.8X", + SBE_TRACF("SUCCESS: get_sbe_reg completed okay for proc 0x%.8X", TARGETING::get_huid(i_target)); } //@TODO-RTC:100963 - this should match the logic in //call_proc_check_slave_sbe_seeprom.C } while(0); - SBE_TRACF(EXIT_MRK "check_sbe_reg"); - return l_ret; + SBE_TRACF(EXIT_MRK "get_sbe_reg()"); } -P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_reg_value( - TARGETING::Target * i_target, - SbeRetryHandler::SBE_REG_RETURN i_sbe_reg, - P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_sbe_error, - bool i_fromStateMachine) +void SbeRetryHandler::handle_sbe_reg_value(TARGETING::Target * i_target) { errlHndl_t l_errl = NULL; - P9_EXTRACT_SBE_RC::RETURN_ACTION l_ret = - P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; SBE_TRACF(ENTER_MRK "handle_sbe_reg_value()"); const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2_proc_target(i_target); - switch(i_sbe_reg) + switch(this->iv_currentSBEState) { case SbeRetryHandler::SBE_REG_RETURN::HWP_ERROR: { SBE_TRACF("handle_sbe_reg_value(): case FUNCTION_ERROR"); // There has been a failure getting the SBE register // We cannot continue any further, return failure. - l_ret = P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; + this->iv_currentAction = P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; break; } case SbeRetryHandler::SBE_REG_RETURN::SBE_AT_RUNTIME: { SBE_TRACF("handle_sbe_reg_value(): case SBE_AT_RUNTIME"); // The SBE has successfully booted at runtime - l_ret = P9_EXTRACT_SBE_RC::ERROR_RECOVERED; + this->iv_currentAction = P9_EXTRACT_SBE_RC::ERROR_RECOVERED; break; } case SbeRetryHandler::SBE_REG_RETURN::SBE_FAILED_TO_BOOT: { SBE_TRACF("handle_sbe_reg_value(): case SBE_FAILED_TO_BOOT"); - if((!i_fromStateMachine) && - (i_current_sbe_error == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM)) + if((this->iv_currentAction == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM) + && (!iv_retriggeredMain)) + { + iv_retriggeredMain = true; #ifdef CONFIG_BMC_IPMI // This could potentially take awhile, reset watchdog l_errl = IPMIWATCHDOG::resetWatchDogTimer(); @@ -434,18 +368,23 @@ P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_reg_value( "REIPL_UPD_SEEPROM failed. Recalling with BKP_SEEPROM"); // If we were trying to reipl and hit the error, we need // to start with a new seeprom before hitting the threshold - proc_extract_sbe_handler(i_target, - P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM); - l_ret = P9_EXTRACT_SBE_RC::ERROR_RECOVERED; + this->iv_currentAction = + P9_EXTRACT_SBE_RC::RETURN_ACTION::REIPL_BKP_SEEPROM; + main_sbe_handler(i_target, true); break; } + // Failed to boot, setting the final action for debugging. SBE_TRACF("Inside handle_sbe_reg_value, calling p9_extract_sbe_rc HWP"); // 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); + this->iv_currentAction = l_rcAction; + + SBE_TRACF("handle_sbe_reg_value(): SBE failed to boot. Final " + "action is %llx", l_rcAction); if(l_errl) { @@ -459,30 +398,6 @@ P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_reg_value( errlCommit( l_errl, HWPF_COMP_ID ); } - if(i_fromStateMachine) - { - l_ret = l_rcAction; - break; - } - - uint8_t l_prevError = (i_target)->getAttr< - TARGETING::ATTR_PREVIOUS_SBE_ERROR>(); - (i_target)->setAttr<TARGETING::ATTR_PREVIOUS_SBE_ERROR>( - l_rcAction); - - if(i_current_sbe_error == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM) - { - // Call sbe_threshold handler on the opposite side - SBE_FSM::sbe_threshold_handler(false, i_target, l_rcAction, - l_prevError, this); - } - else - { - // Call sbe_threshold handler on the same side - SBE_FSM::sbe_threshold_handler(true, i_target, l_rcAction, - l_prevError, this); - } - l_ret = P9_EXTRACT_SBE_RC::ERROR_RECOVERED; break; } default: @@ -495,7 +410,7 @@ P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_reg_value( * @moduleid SBEIO_HANDLE_SBE_REG_VALUE * @reasoncode SBEIO_INCORRECT_FCN_CALL * @userdata1 HUID of target - * @userdata2 check_sbe_reg return value + * @userdata2 SBE current state * @devdesc This function was called incorrectly or * there is a new enum that is not handled yet. */ @@ -503,57 +418,24 @@ P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_reg_value( ERRORLOG::ERRL_SEV_INFORMATIONAL, SBEIO_HANDLE_SBE_REG_VALUE, SBEIO_INCORRECT_FCN_CALL, - get_huid(i_target),i_sbe_reg); + get_huid(i_target),this->iv_currentSBEState); l_errl->collectTrace("ISTEPS_TRACE",256); errlCommit(l_errl, ISTEP_COMP_ID); - l_ret = P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; + this->iv_currentAction = P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; break; } } - SBE_TRACF(EXIT_MRK "handle_sbe_reg_value()"); - return l_ret; } -P9_EXTRACT_SBE_RC::RETURN_ACTION SbeRetryHandler::handle_sbe_restart( - TARGETING::Target * i_target, - bool i_fromStateMachine, - P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_condition) -{ - SBE_TRACF(ENTER_MRK "handle_sbe_restart()"); - - errlHndl_t l_errl = NULL; - - const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> - l_fapi2_proc_target (i_target); - - FAPI_INVOKE_HWP(l_errl, p9_start_cbs, l_fapi2_proc_target, true); - if(l_errl) - { - SBE_TRACF("ERROR: call p9_start_cbs, " - "PLID=0x%x", l_errl->plid() ); - l_errl->collectTrace( "ISTEPS_TRACE", 256); - - errlCommit(l_errl, ISTEP_COMP_ID); - } - - SbeRetryHandler::SBE_REG_RETURN l_checkSBE = check_sbe_reg(i_target); - P9_EXTRACT_SBE_RC::RETURN_ACTION l_ret = handle_sbe_reg_value(i_target, - l_checkSBE, i_current_condition, i_fromStateMachine); - - SBE_TRACF(EXIT_MRK "handle_sbe_restart()"); - return l_ret; -} - -errlHndl_t SbeRetryHandler::sbe_timeout_handler(sbeMsgReg_t * o_sbeReg, - TARGETING::Target * i_target, - SbeRetryHandler::SBE_REG_RETURN * o_returnAction) +errlHndl_t SbeRetryHandler::sbe_timeout_handler(TARGETING::Target * i_target) { SBE_TRACF(ENTER_MRK "sbe_timeout_handler()"); errlHndl_t l_errl = NULL; - (*o_returnAction) = SbeRetryHandler::SBE_REG_RETURN::SBE_FAILED_TO_BOOT; + this->iv_currentSBEState = + SbeRetryHandler::SBE_REG_RETURN::SBE_FAILED_TO_BOOT; const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2_proc_target(i_target); @@ -574,31 +456,36 @@ errlHndl_t SbeRetryHandler::sbe_timeout_handler(sbeMsgReg_t * o_sbeReg, for( uint64_t l_loops = 0; l_loops < SBE_NUM_LOOPS; l_loops++ ) { - (*o_sbeReg).reg = 0; + sbeMsgReg_t l_reg; FAPI_INVOKE_HWP(l_errl, p9_get_sbe_msg_register, - l_fapi2_proc_target, (*o_sbeReg)); + l_fapi2_proc_target, l_reg); + this->iv_sbeRegister = l_reg; if (l_errl) { SBE_TRACF("ERROR : call p9_get_sbe_msg_register, PLID=0x%x, " "on loop %d", l_errl->plid(), l_loops ); - (*o_returnAction) = SbeRetryHandler::SBE_REG_RETURN::HWP_ERROR; + this->iv_currentSBEState = + SbeRetryHandler::SBE_REG_RETURN::HWP_ERROR; break; } - else if ((*o_sbeReg).currState == SBE_STATE_RUNTIME) + else if ((this->iv_sbeRegister).currState == SBE_STATE_RUNTIME) { - SBE_TRACF("SBE 0x%.8X booted and at runtime, o_sbeReg=0x%.8X, " - "on loop %d", - TARGETING::get_huid(i_target), (*o_sbeReg).reg, + SBE_TRACF("SBE 0x%.8X booted and at runtime, " + "iv_sbeRegister=0x%.8X, on loop %d", + TARGETING::get_huid(i_target), + (this->iv_sbeRegister).reg, l_loops); - (*o_returnAction) = SbeRetryHandler::SBE_REG_RETURN::SBE_AT_RUNTIME; + this->iv_currentSBEState = + SbeRetryHandler::SBE_REG_RETURN::SBE_AT_RUNTIME; break; } - else if ((*o_sbeReg).asyncFFDC) + else if ((this->iv_sbeRegister).asyncFFDC) { - SBE_TRACF("SBE 0x%.8X has async FFDC bit set, o_sbeReg=0x%.8X", - TARGETING::get_huid(i_target), (*o_sbeReg).reg); + SBE_TRACF("SBE 0x%.8X has async FFDC bit set, " + "iv_sbeRegister=0x%.8X",TARGETING::get_huid(i_target), + (this->iv_sbeRegister).reg); // Async FFDC is indicator that SBE is failing to boot, and if // in DUMP state, that SBE is done dumping, so leave loop break; @@ -607,16 +494,17 @@ errlHndl_t SbeRetryHandler::sbe_timeout_handler(sbeMsgReg_t * o_sbeReg, { if( !(l_loops % 10) ) { - SBE_TRACF("%d> SBE 0x%.8X NOT booted yet, o_sbeReg=0x%.8X", - l_loops, TARGETING::get_huid(i_target), - (*o_sbeReg).reg); + SBE_TRACF("%d> SBE 0x%.8X NOT booted yet, " + "iv_sbeRegister=0x%.8X", l_loops, + TARGETING::get_huid(i_target), + (this->iv_sbeRegister).reg); } l_loops++; nanosleep(0,SBE_WAIT_SLEEP); } } - if ((*o_sbeReg).currState != SBE_STATE_RUNTIME) + if ((this->iv_sbeRegister).currState != SBE_STATE_RUNTIME) { // Switch to using FSI SCOM TARGETING::ScomSwitches l_switches = @@ -775,8 +663,9 @@ bool SbeRetryHandler::sbe_get_ffdc_handler(TARGETING::Target * i_target) l_action = action_for_ffdc_rc(l_rc); // Handle that action - proc_extract_sbe_handler(i_target, - l_action); + this->iv_currentAction = l_action; + this->iv_retriggeredMain = true; + main_sbe_handler(i_target, true); } // If there are FFDC packages, commit the log @@ -801,16 +690,15 @@ bool SbeRetryHandler::sbe_get_ffdc_handler(TARGETING::Target * i_target) return l_flowCtrl; } -void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, - sbeMsgReg_t i_sbeReg, - SBE_REG_RETURN * o_regReturn) +bool SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target) { SBE_TRACF(ENTER_MRK "sbe_boot_fail_handler()"); errlHndl_t l_errl = nullptr; + bool o_needRetry = false; SBE_TRACF("SBE 0x%.8X never started, sbeReg=0x%.8X", - TARGETING::get_huid(i_target),i_sbeReg.reg ); + TARGETING::get_huid(i_target),(this->iv_sbeRegister).reg ); /*@ * @errortype * @reasoncode SBEIO_SLAVE_TIMEOUT @@ -828,7 +716,7 @@ void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, SBEIO_EXTRACT_RC_HANDLER, SBEIO_SLAVE_TIMEOUT, TARGETING::get_huid(i_target), - i_sbeReg.reg); + (this->iv_sbeRegister).reg); l_errl->collectTrace( "ISTEPS_TRACE", KILOBYTE/4); @@ -841,23 +729,21 @@ void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, // Setup for the HWP const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget( const_cast<TARGETING::Target*> (i_target)); - 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_fapi2ProcTarget, l_rcAction); - - //TODO:RTC 180961 handle error. ^^ + P9_EXTRACT_SBE_RC::RETURN_ACTION l_ret = + P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM; + FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc, + l_fapi2ProcTarget, l_ret); + this->iv_currentAction = l_ret; - if(l_rcAction != P9_EXTRACT_SBE_RC::ERROR_RECOVERED) + if(this->iv_currentAction != P9_EXTRACT_SBE_RC::ERROR_RECOVERED) { - if(l_errl) //TODO:RTC 180961 handle error ^^ + if(l_errl) { - SBE_TRACF("Error found from p9_extract_sbe, fixing later"); SBE_TRACF("p9_extract_sbe_rc HWP returned action %d and errorlog " - "PLID=0x%x, rc=0x%.4X", l_rcAction, l_errl->plid(), - l_errl->reasonCode() ); + "PLID=0x%x, rc=0x%.4X", this->iv_currentAction, + l_errl->plid(), l_errl->reasonCode() ); delete l_errl; l_errl = nullptr; } @@ -871,8 +757,6 @@ void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, TARGETING::get_huid(i_target)); } - // Save the current rc error - (i_target)->setAttr<TARGETING::ATTR_PREVIOUS_SBE_ERROR>(l_rcAction); #ifdef CONFIG_BMC_IPMI // This could potentially take awhile, reset watchdog l_errl = IPMIWATCHDOG::resetWatchDogTimer(); @@ -884,27 +768,29 @@ void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, errlCommit(l_errl,ISTEP_COMP_ID); } #endif - - // Only attempt to recover twice before erroring out - if((l_rcAction == P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION) && - (g_switch_sides_count < 2)) + SBE_TRACF("sbe_boot_fail_handler. iv_switchSides count is %llx", + iv_switchSidesCount); + if((this->iv_currentAction == P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION) && + (iv_switchSidesCount < MAX_SWITCH_SIDE_COUNT)) + { + this->iv_currentAction = P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM; + o_needRetry = true; + } + else if(iv_switchSidesCount >= MAX_SWITCH_SIDE_COUNT) { - // Change action to attempt coming up from backup SEEPROM - l_rcAction = P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM; + o_needRetry = false; + } + else + { + o_needRetry = true; } - // Handle the p9_extract_sbe_rc results (as modified) - // Pass o_regReturn back through call chain. - proc_extract_sbe_handler( i_target, - l_rcAction, - o_regReturn); } - if(l_errl) { SBE_TRACF("Error: sbe_boot_fail_handler : p9_extract_sbe_rc HWP " " returned action %d and errorlog PLID=0x%x, rc=0x%.4X", - l_rcAction, l_errl->plid(), l_errl->reasonCode()); + this->iv_currentAction, l_errl->plid(), l_errl->reasonCode()); // Capture the target data in the elog ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog( l_errl ); @@ -913,8 +799,9 @@ void SbeRetryHandler::sbe_boot_fail_handler(TARGETING::Target * i_target, errlCommit( l_errl, HWPF_COMP_ID ); } - SBE_TRACF(EXIT_MRK "sbe_boot_fail_handler()"); - return; + SBE_TRACF(EXIT_MRK "sbe_boot_fail_handler() current action is %llx", + this->iv_currentAction); + return o_needRetry; } errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target) @@ -952,22 +839,25 @@ errlHndl_t SbeRetryHandler::switch_sbe_sides(TARGETING::Target * i_target) { // Set Boot Side 0 by clearing bit for side 1 SBE_TRACF( "switch_sbe_sides #%d: Set Boot Side 0 for HUID 0x%08X", - g_switch_sides_count, + iv_switchSidesCount, TARGETING::get_huid(i_target)); l_read_reg &= ~l_sbeBootSelectMask; + this->iv_sbeSide = 1; } else // Currently set for Boot Side 0 { // Set Boot Side 1 by setting bit for side 1 SBE_TRACF( "switch_sbe_sides #%d: Set Boot Side 1 for HUID 0x%08X", - g_switch_sides_count, + iv_switchSidesCount, TARGETING::get_huid(i_target)); l_read_reg |= l_sbeBootSelectMask; + this->iv_sbeSide = 0; } + SBE_TRACF("switch_sbe_sides(): iv_switchSidesCount is %llx", + iv_switchSidesCount); // Increment switch sides count - ++g_switch_sides_count; - this->iv_sbeOtherSide = true; + ++iv_switchSidesCount; // Write updated PERV_SB_CS_FSI 0x2820 back into target proc l_errl = DeviceFW::deviceOp( diff --git a/src/usr/sbeio/sbe_threshold_fsm.C b/src/usr/sbeio/sbe_threshold_fsm.C deleted file mode 100644 index 72f5fa26b..000000000 --- a/src/usr/sbeio/sbe_threshold_fsm.C +++ /dev/null @@ -1,288 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/sbeio/sbe_threshold_fsm.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -/*****************************************************************************/ -// Includes -/*****************************************************************************/ -#include <stdint.h> -#include <trace/interface.H> -#include <errl/errlentry.H> -#include <errl/errlmanager.H> -#include <ipmi/ipmiwatchdog.H> -#include <sbeio/sbe_retry_handler.H> -#include "sbe_threshold_fsm.H" -#include <sbeio/sbeioreasoncodes.H> - -extern trace_desc_t* g_trac_sbeio; - -#define SBE_FSM_TRACF(printf_string,args...) \ - TRACFCOMP(g_trac_sbeio,"sbe_threshold_fsm.C: " printf_string,##args) -#define SBE_FSM_TRACD(printf_string,args...) \ - TRACDCOMP(g_trac_sbeio,"sbe_threshold_fsm.C: " printf_string,##args) -#define SBE_FSM_TRACU(args...) -#define SBE_FSM_TRACFBIN(printf_string,args...) \ - TRACFBIN(g_trac_sbeio,"sbe_threshold_fsm.C: " printf_string,##args) -#define SBE_FSM_TRACDBIN(printf_string,args...) \ - TRACDBIN(g_trac_sbeio,"sbe_threshold_fsm.C: " printf_string,##args) - - - -using namespace SBEIO; - -namespace SBE_FSM -{ - -P9_EXTRACT_SBE_RC::RETURN_ACTION (* sbe_handler_state[])( - TARGETING::Target * i_target, - uint8_t i_prev_error, - SbeRetryHandler * i_obj) = - { same_side_retry_state, // SAME_SIDE_RETRY - other_side_state, // OTHER_SIDE - working_exit_state, // WORKING_EXIT - failing_exit_state }; // FAILING_EXIT - -enum STATE_CODES { SAME_SIDE_RETRY, - OTHER_SIDE, - WORKING_EXIT, - FAILING_EXIT }; - -struct transition -{ - enum STATE_CODES src_state; - uint8_t ret_code; - enum STATE_CODES dst_state; -}; - -// transistions from end states aren't needed // -struct transition state_transitions[] = { - { SAME_SIDE_RETRY, 0, WORKING_EXIT }, - { SAME_SIDE_RETRY, 1, OTHER_SIDE }, - { OTHER_SIDE, 0, WORKING_EXIT }, - { OTHER_SIDE, 1, FAILING_EXIT } -}; - -enum STATE_CODES get_next_state( enum STATE_CODES i_src, uint8_t i_rc ) -{ - return (state_transitions[ i_src*2 + i_rc ]).dst_state; -} - -void sbe_threshold_handler( bool i_procSide, - TARGETING::Target * i_target, - P9_EXTRACT_SBE_RC::RETURN_ACTION i_initialAction, - uint8_t i_previousError, - SbeRetryHandler * i_obj ) -{ - SBE_FSM_TRACF(ENTER_MRK, "sbe_threshold_handler()"); - - // Note: This is set up as a finite state machine since all actions are - // connected and most of them lead to another. - - STATE_CODES cur_state = SAME_SIDE_RETRY; - - // The initial state depends on our inputs - if( i_procSide ) - { - cur_state = OTHER_SIDE; - } - - // Setup the rest of the FSM - P9_EXTRACT_SBE_RC::RETURN_ACTION l_returnedAction; - P9_EXTRACT_SBE_RC::RETURN_ACTION (*state_fcn)(TARGETING::Target * i_target, - uint8_t i_orig_error, SbeRetryHandler * i_obj); - - // Begin FSM - for(;;) - { -#ifdef CONFIG_BMC_IPMI - // This could potentially take awhile, reset watchdog - errlHndl_t l_errl = IPMIWATCHDOG::resetWatchDogTimer(); - if(l_errl) - { - SBE_FSM_TRACF("Inside sbe_extract_dd FSM, " - "Resetting watchdog"); - l_errl->collectTrace("ISTEPS_TRACE",256); - errlCommit(l_errl,ISTEP_COMP_ID); - } -#endif - - state_fcn = SBE_FSM::sbe_handler_state[cur_state]; - l_returnedAction = state_fcn(i_target, i_initialAction, i_obj); - - if( cur_state == WORKING_EXIT || - cur_state == FAILING_EXIT) - { - break; - } - // If the returned action was 0, the return is a pass: 0, - // Else, the SBE did not start cleanly and we continue - cur_state = get_next_state(cur_state, - !(P9_EXTRACT_SBE_RC::ERROR_RECOVERED == l_returnedAction)); - - } - - return; -} - -P9_EXTRACT_SBE_RC::RETURN_ACTION same_side_retry_state( - TARGETING::Target * i_target, - uint8_t i_orig_error, - SbeRetryHandler * i_obj) -{ - SBE_FSM_TRACF(ENTER_MRK, "same_side_retry_state(): " - "Running p9_start_cbs HWP on processor target %.8X", - TARGETING::get_huid(i_target)); - - // We don't actually need an accurate p9_extract_sbe_rc value if - // we're coming from the state machine, so we send in a pass. - return i_obj->handle_sbe_restart(i_target,true, - P9_EXTRACT_SBE_RC::ERROR_RECOVERED); -} - -P9_EXTRACT_SBE_RC::RETURN_ACTION other_side_state( - TARGETING::Target * i_target, - uint8_t i_orig_error, - SbeRetryHandler * i_obj) -{ - SBE_FSM_TRACF(ENTER_MRK, "other_side_state(): " - "Running p9_start_cbs HWP on processor target %.8X", - TARGETING::get_huid(i_target)); - - errlHndl_t l_errl = NULL; - - // Run HWP, but from the other side. - const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> - l_fapi2_proc_target(i_target); - - l_errl = i_obj->switch_sbe_sides(i_target); - if(l_errl) - { - errlCommit(l_errl,ISTEP_COMP_ID); - return P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION; - } - - // We don't actually need an accurate p9_extract_sbe_rc value if - // we're coming from the state machine, so we send in a pass. - P9_EXTRACT_SBE_RC::RETURN_ACTION l_ret = - i_obj->handle_sbe_restart(i_target, true, - P9_EXTRACT_SBE_RC::ERROR_RECOVERED); - if(i_target->getAttr<TARGETING::ATTR_SBE_IS_STARTED>()) - { - // Information log - /*@ - * @errortype - * @moduleid SBEIO_THRESHOLD_FSM - * @reasoncode SBEIO_BOOTED_UNEXPECTED_SIDE_BKP - * @userdata1 SBE status reg - * @userdata2 HUID - * @devdesc The SBE has booted on an unexpected side - */ - l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - SBEIO_THRESHOLD_FSM, - SBEIO_BOOTED_UNEXPECTED_SIDE_BKP, - l_ret, - get_huid(i_target)); - - l_errl->collectTrace( "ISTEPS_TRACE", 256); - - errlCommit(l_errl, ISTEP_COMP_ID); - - } - - return l_ret; -} - -P9_EXTRACT_SBE_RC::RETURN_ACTION working_exit_state( - TARGETING::Target * i_target, - uint8_t i_orig_error, - SbeRetryHandler * i_obj) -{ - SBE_FSM_TRACF(ENTER_MRK, "working_exit_state()"); - return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass -} - -P9_EXTRACT_SBE_RC::RETURN_ACTION failing_exit_state( - TARGETING::Target * i_target, - uint8_t i_orig_error, - SbeRetryHandler * i_obj) -{ - SBE_FSM_TRACF(ENTER_MRK, "failing_exit_state()"); - errlHndl_t l_errl = NULL; - - // Look at original error - // Escalate to REIPL_BKP_SEEPROM (recall fcn) - if( (i_orig_error == P9_EXTRACT_SBE_RC::RESTART_SBE) || - (i_orig_error == P9_EXTRACT_SBE_RC::RESTART_CBS) || - (i_orig_error == P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM) ) - { -#ifdef CONFIG_BMC_IPMI - // This could potentially take awhile, reset watchdog - l_errl = IPMIWATCHDOG::resetWatchDogTimer(); - if(l_errl) - { - SBE_FSM_TRACF("Inside sbe_extract_dd FSM, before sbe_handler " - "Resetting watchdog"); - l_errl->collectTrace("ISTEPS_TRACE",256); - errlCommit(l_errl,ISTEP_COMP_ID); - } -#endif - i_obj->proc_extract_sbe_handler(i_target, - P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM); - } - - // Gard and callout proc, return back to 8.4 - else if(i_orig_error == P9_EXTRACT_SBE_RC::REIPL_BKP_SEEPROM) - { - // There is no action possible. Gard and Callout the proc - /*@ - * @errortype ERRL_SEV_UNRECOVERABLE - * @moduleid SBEIO_THRESHOLD_FSM - * @reasoncode SBEIO_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, - SBEIO_THRESHOLD_FSM, - SBEIO_NO_RECOVERY_ACTION, - i_orig_error, - TARGETING::get_huid(i_target)); - l_errl->collectTrace( "ISTEPS_TRACE", 256); - l_errl->addHwCallout( i_target, - HWAS::SRCI_PRIORITY_HIGH, - HWAS::DECONFIG, - HWAS::GARD_Predictive ); - errlCommit(l_errl, ISTEP_COMP_ID); - - } - - return P9_EXTRACT_SBE_RC::ERROR_RECOVERED; //pass -} -// end FSM - -}; // End of namespace SBE_FSM - diff --git a/src/usr/sbeio/sbe_threshold_fsm.H b/src/usr/sbeio/sbe_threshold_fsm.H deleted file mode 100644 index f0d048521..000000000 --- a/src/usr/sbeio/sbe_threshold_fsm.H +++ /dev/null @@ -1,109 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/sbeio/sbe_threshold_fsm.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -#include <p9_extract_sbe_rc.H> -#include <sbeio/sbe_retry_handler.H> - -namespace SBE_FSM -{ - -/** - * @brief This is the initial retry. If we get to a failure, we - * attempt to reboot the SBE on the other side. - * - * @param[in] i_target - current proc target - * @param[in] i_orig_error - Original SBE error - * @param[in] i_obj - SbeRetryHandler object - * - * @return - pass(0) or specific returned SBE error - */ -P9_EXTRACT_SBE_RC::RETURN_ACTION same_side_retry_state( - TARGETING::Target * i_target,uint8_t i_orig_error, - SBEIO::SbeRetryHandler * i_obj); - -/** - * @brief This is the other side retry. If we fail twice on the same - * side. We attempt to reboot the SBE on the other proc. - * - * @param[in] i_target - current proc target - * @param[in] i_orig_error - Original SBE error - * @param[in] i_obj - SbeRetryHandler object - * - * @return - pass(0) or specific returned SBE error - */ -P9_EXTRACT_SBE_RC::RETURN_ACTION other_side_state( - TARGETING::Target * i_target,uint8_t i_orig_error, - SBEIO::SbeRetryHandler * i_obj); - -/** - * @brief This is the working (passing) exit state. This state occurs - * when we start an SBE correctly within the threshold FSM. - * Depending on which state we come from, there are some - * different functions. - * - * @param[in] i_target - current proc target - * @param[in] i_orig_error - Original SBE error - * @param[in] i_obj - SbeRetryHandler object - * - * @return - pass(0) or specific returned SBE error - */ -P9_EXTRACT_SBE_RC::RETURN_ACTION working_exit_state( - TARGETING::Target * i_target,uint8_t i_orig_error, - SBEIO::SbeRetryHandler * i_obj); - -/** - * @brief This is the failing exit state. This state only occurs when - * we fail on every retry. In this case we look at where we - * came from and either escalate to REIPL_BKP_SEEPROM or we gard - * and callout this proc and return to complete the istep. - * - * @param[in] i_target - current proc target - * @param[in] i_orig_error - Original SBE error - * @param[in] i_obj - SbeRetryHandler object - * - * @return - pass(0) or specific returned SBE error - */ -P9_EXTRACT_SBE_RC::RETURN_ACTION failing_exit_state( - TARGETING::Target * i_target,uint8_t i_orig_error, - SBEIO::SbeRetryHandler * i_obj); - -/** - * @brief This is the main function of the finite state machine. It - * handles the outputs, current state and next - * state transitions. - * - * @param[in] i_procSide - Which side we want to try to reboot. - * false/true: current/other - * @param[in] i_target - Current Proc target - * @param[in] i_currentAction - Most recent return value from HWP - * @param[in] i_previousError - The previous return value from HWP - * @param[in] i_obj - SbeRetryHandler object - */ -void sbe_threshold_handler( bool i_procSide, - TARGETING::Target * i_target, - P9_EXTRACT_SBE_RC::RETURN_ACTION i_currentAction, - uint8_t i_previousError, - SBEIO::SbeRetryHandler * i_obj ); - -}; // End of namespace SBE_FSM diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 955e3786d..1b7c2f2b0 100755 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -7396,20 +7396,6 @@ Selects which voltage level to place the Core and ECO domain PFETs upon Winkle e </attribute> <attribute> - <id>PREVIOUS_SBE_ERROR</id> - <description> - Keeps track of the previous SBE error. We need to know - what last occurred to know what action we need to take. - </description> - <simpleType> - <uint8_t><default>0</default></uint8_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> -</attribute> - -<attribute> <id>MC_PLL_BUCKET</id> <description> MC pll bucket selection in async mode for Cumulus diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 4957f7874..364fb33d3 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -275,7 +275,6 @@ <attribute> <id>DISABLE_I2C_ENGINE2_PORT0_DIAG_MODE</id> </attribute> - <attribute><id>PREVIOUS_SBE_ERROR</id></attribute> </targetType> <targetType> |