Skip to content

Commit

Permalink
Add error handling to TOD code
Browse files Browse the repository at this point in the history
Change-Id: I8485b7180aaccc6c8d7db1ba7279933b10d94435
RTC: 161602
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41881
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: Matthew A. Ploetz <maploetz@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Dzuy Nguyen authored and dcrowell77 committed Jun 30, 2017
1 parent 178ec2a commit 205f3c4
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 134 deletions.
122 changes: 57 additions & 65 deletions src/usr/isteps/istep18/TodControls.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <p9_perv_scom_addresses.H>
#include <p9_tod_setup.H>
#include <errl/errlentry.H>
#include <errl/errludtarget.H>
#include <p9_tod_utils.H>
#include <isteps/tod_init_reasoncodes.H>

Expand Down Expand Up @@ -152,6 +153,7 @@ errlHndl_t TodControls ::pickMdmt(const p9_tod_setup_tod_sel i_config)
GETHUID(l_procItr->getTarget()),
l_drwItr->getId(),
i_config);
errlCommit(l_errHdl, TOD_COMP_ID);
}
break;
}
Expand Down Expand Up @@ -214,6 +216,7 @@ errlHndl_t TodControls ::pickMdmt(const p9_tod_setup_tod_sel i_config)
getAttr<TARGETING::ATTR_HUID>(),
l_pTodDrw->getId(),
i_config);
errlCommit(l_errHdl, TOD_COMP_ID);
}
}
}
Expand All @@ -234,11 +237,37 @@ errlHndl_t TodControls ::pickMdmt(const p9_tod_setup_tod_sel i_config)
* @custdesc Host Processor Firmware couldn't detect any
* functional master processor required to boot the host
*/
const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_PICK_MDMT,
TOD_MASTER_TARGET_NOT_FOUND,
i_config);
i_config,
hbSwError);

//Check the list of garded targets on the system and pick the garded
//targets for adding it into FFDC data.
//
std::vector<TARGETING::ATTR_HUID_type>::iterator l_iter;

for ( l_iter = iv_gardedTargets.begin();
l_iter != iv_gardedTargets.end();
++l_iter )
{
//Get the target corresponding to the HUID stored in
//iv_gardedTargets
TARGETING::Target* l_pTarget =
TARGETING::Target::getTargetFromHuid(*l_iter);
if ( l_pTarget )
{
if ( TARGETING::TYPE_PROC == GETTYPE(l_pTarget))
{
// Add garded PROC targets into the errorlog
ERRORLOG::ErrlUserDetailsTarget(l_pTarget,
"GARDed Part").addToLog(l_errHdl);
}
}
}
}
else
{
Expand Down Expand Up @@ -300,11 +329,13 @@ errlHndl_t TodControls::buildTodDrawers(
* @userdata1 system target's HUID
* @devdesc MDMT could not find a functional node
*/
const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_BUILD_TOD_DRAWERS,
TOD_NO_FUNC_NODE_AVAILABLE,
l_pSysTarget->getAttr<ATTR_HUID>());
l_pSysTarget->getAttr<ATTR_HUID>(),
hbSwError);
break;
}

Expand Down Expand Up @@ -426,6 +457,11 @@ errlHndl_t TodControls::buildTodDrawers(
TOD_BUILD_TOD_DRAWERS,
TOD_NO_DRAWERS,
i_config);

l_errHdl->addProcedureCallout(
HWAS::EPUB_PRC_FIND_DECONFIGURED_PART,
HWAS::SRCI_PRIORITY_LOW);

}

}while(0);
Expand Down Expand Up @@ -568,7 +604,7 @@ errlHndl_t TodControls ::queryActiveConfig(
* configuring Time Of Day on the Host processors
*/
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_QUERY_ACTIVE_CONFIG,
TOD_NO_VALID_MDMT_FOUND);
break;
Expand Down Expand Up @@ -683,11 +719,13 @@ errlHndl_t TodControls ::queryActiveConfig(
* @custdesc Service Processor Firmware encountered an
* internal error
*/
const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_QUERY_ACTIVE_CONFIG,
TOD_NO_MDMT_ON_ACTIVE_CONFIG,
o_activeConfig);
o_activeConfig,
hbSwError);
break;
}
}//isTodRunning check
Expand Down Expand Up @@ -1460,13 +1498,9 @@ errlHndl_t TodControls::gardGetGardedUnits(
{
TARGETING::Target * l_pTarget = NULL;

l_err = getTargetFromPhysicalPath(l_iter.iv_targetId,
l_pTarget);
if(l_err != NULL)
{
TOD_ERR("Error finding target");
break;
}
// getTargetFromPhysicalPath will either succeed or assert
getTargetFromPhysicalPath(l_iter.iv_targetId, l_pTarget);

GardedUnit_t l_gardedUnit;
memset(&l_gardedUnit,0,sizeof(GardedUnit_t));
l_gardedUnit.iv_huid =
Expand Down Expand Up @@ -1526,39 +1560,22 @@ errlHndl_t TodControls::gardGetGardedUnits(
// getTargetFromPhysicalPath
//******************************************************************************

errlHndl_t TodControls::getTargetFromPhysicalPath(
void TodControls::getTargetFromPhysicalPath(
const TARGETING::ATTR_PHYS_PATH_type &i_path,
TARGETING::Target*& o_pTarget)

{
TOD_ENTER("getTargetFromPhysicalPath");
errlHndl_t l_err = NULL;
do
{
o_pTarget =
TARGETING::targetService().toTarget(i_path);
if(o_pTarget == NULL)
{
TOD_ERR("Error in getting target from entity path[%s]",
getPhysicalPathString(i_path));
/*@
* @errortype
* @moduleid TOD_CONTROLS_GET_TARGET
* @reasoncode TOD_NULL_INPUT_TARGET
* @devdesc Target ID is invalid
* @custdesc Service Processor Firmware encountered an internal
* error
*/
l_err = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
TOD_CONTROLS_GET_TARGET,
TOD_NULL_INPUT_TARGET);
break;
}
TOD_ERR_ASSERT(o_pTarget != NULL,
"Error in getting target from entity path[%s]",
getPhysicalPathString(i_path));
}
while(0);
TOD_EXIT();
return l_err;
}

//******************************************************************************
Expand Down Expand Up @@ -1589,26 +1606,7 @@ errlHndl_t TodControls::getParent(const TARGETING::Target *i_pTarget,

do
{
// If i_pTarget is NULL then create an error log
if(!i_pTarget)
{
TOD_ERR("Input Target handle is null");

//Create error
/*@
* @errortype
* @moduleid TOD_UTIL_MOD_GET_PARENT
* @reasoncode TOD_NULL_INPUT_TARGET
* @devdesc NULL Target is supplied as input
* @custdesc Service Processor Firmware encountered an internal
* error
*/
l_errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
TOD_UTIL_MOD_GET_PARENT,
TOD_NULL_INPUT_TARGET);
break;
}
TOD_ERR_ASSERT(i_pTarget != NULL, "Input Target handle is null");

// If we have a valid target, check if it is system
l_type = i_pTarget->getAttr<TARGETING::ATTR_TYPE>();
Expand All @@ -1635,11 +1633,13 @@ errlHndl_t TodControls::getParent(const TARGETING::Target *i_pTarget,
* error
*/

const bool hbSwError = true;
l_errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_UTIL_MOD_GET_PARENT,
TOD_INVALID_TARGET,
GETHUID(i_pTarget));
GETHUID(i_pTarget),
hbSwError);

break;
}
Expand Down Expand Up @@ -1701,14 +1701,6 @@ errlHndl_t TodControls::getParent(const TARGETING::Target *i_pTarget,
GETHUID(i_pTarget),
TWO_UINT32_TO_UINT64(l_list.size(), i_class));

// Assert will R/R the FSP, set the R/R bit in this error
// to indicate that this error is responsible for the R/R
//l_errl->setRsrlBit(true);

TOD_ERR_ASSERT(0, "ERROR - Parent not found for the supplied target."
"Supplied target's HUID: 0x%08X",
GETHUID(i_pTarget));

}

TOD_EXIT();
Expand Down
7 changes: 2 additions & 5 deletions src/usr/isteps/istep18/TodControls.H
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,10 @@ private:
* @param[out] o_Target
* Pointer to Target
*
* @return errlHndl_t
* Returns error handle if supplied physical path
* is not valid
* else NULL
* assert if supplied physical path is not valid
*/

errlHndl_t getTargetFromPhysicalPath(
void getTargetFromPhysicalPath(
const TARGETING::ATTR_PHYS_PATH_type &i_path,
TARGETING::Target*& o_pTarget);

Expand Down
14 changes: 9 additions & 5 deletions src/usr/isteps/istep18/TodDrawer.C
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ errlHndl_t TodDrawer::findMasterProc(TodProc*& o_drawerMaster) const
* host
*/

const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_FIND_MASTER_PROC,
TOD_NO_MASTER_PROC,
iv_todDrawerId);
iv_todDrawerId,
hbSwError);
}
}while(0);

Expand Down Expand Up @@ -237,7 +239,7 @@ void TodDrawer::getPotentialMdmts(
{
TOD_ENTER("TodDrawer::getPotentialMdmts");
bool l_isGARDed = false;
errlHndl_t l_errHndl = NULL;
errlHndl_t l_errHdl = NULL;

const TARGETING::Target* l_procTarget = NULL;

Expand All @@ -250,15 +252,17 @@ void TodDrawer::getPotentialMdmts(
if ( !(TOD::isProcBlackListed(l_procTarget)) )
{
//Check if the target is not garded
l_errHndl = TOD::checkGardStatusOfTarget(l_procTarget,
l_errHdl = TOD::checkGardStatusOfTarget(l_procTarget,
l_isGARDed);

if(l_errHndl)
if(l_errHdl)
{
TOD_ERR("Failed in checkGardStatusOfTarget() to get the "
" GARD state for the target 0x%.8x",
GETHUID(l_procTarget));

errlCommit(l_errHdl, TOD_COMP_ID);

//Ignore this target as the gard status for this target
//could not be obtained.
continue;
Expand Down
60 changes: 8 additions & 52 deletions src/usr/isteps/istep18/TodHwpIntf.C
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,6 @@ errlHndl_t todSetupHwp(const p9_tod_setup_tod_sel i_topologyType)
l_pMDMT->getMasterType(),
l_pMDMT->getBusIn(), l_pMDMT->getBusOut());

/*@
* @errortype
* @moduleid TOD_SETUP_HWP
* @reasoncode TOD_HWP_EXECUTION_FAILED
* @userdata1 MDMT HUID
* @userdata2 Topology Type
* @devdesc Failed to configure TOD toplogy, due to
* error returned by p9_tod_setup.
* @custdesc Service Processor Firmware encountered an
* internal error
*/
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
TOD_SETUP_HWP,
TOD_HWP_EXECUTION_FAILED,
GETHUID(l_pMDMT->getTarget()),
i_topologyType);
break;
}
}while(0);
Expand Down Expand Up @@ -135,11 +118,13 @@ errlHndl_t todSaveRegsHwp(const p9_tod_setup_tod_sel i_topologyType)
* @custdesc Host failed to boot because there was a problem
* configuring Time Of Day on the Host processors
*/
const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_SAVEREGS_HWP,
TOD_NO_VALID_MDMT_FOUND,
i_topologyType);
i_topologyType,
hbSwError);
break;
}

Expand All @@ -159,21 +144,6 @@ errlHndl_t todSaveRegsHwp(const p9_tod_setup_tod_sel i_topologyType)
l_pMDMT->getMasterType(),
l_pMDMT->getBusIn(), l_pMDMT->getBusOut());

/*@
* @errortype
* @moduleid TOD_SAVEREGS_HWP
* @reasoncode TOD_HWP_EXECUTION_FAILED
* @userdata1 Topology Type
* @devdesc Failed to save TOD configuration registers,
* due to error returned by p9_tod_save_config.
* @custdesc Service Processor Firmware encountered an
* internal error
*/
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
TOD_SAVEREGS_HWP,
TOD_HWP_EXECUTION_FAILED,
i_topologyType);
break;
}
}while(0);
Expand Down Expand Up @@ -209,12 +179,14 @@ errlHndl_t todInitHwp()
* @custdesc Host failed to boot because there was a problem
* configuring Time Of Day on the Host processors
*/
const bool hbSwError = true;
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
TOD_INIT_HWP,
TOD_NO_VALID_MDMT_FOUND,
EMOD_TOD_INIT_HWP,
TOD_PRIMARY);
TOD_PRIMARY,
hbSwError);
break;
}

Expand All @@ -236,22 +208,6 @@ errlHndl_t todInitHwp()
GETHUID(l_pMDMT->getTarget()),
l_pMDMT->getMasterType());

/*@
* @errortype
* @moduleid TOD_INIT_HWP
* @reasoncode TOD_HWP_EXECUTION_FAILED
* @userdata1 MDMT HUID
* @devdesc Failed to initialize TOD, due to
* error returned by p9_tod_init.
* @custdesc Service Processor Firmware encountered an
* internal error
*/
l_errHdl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
TOD_INIT_HWP,
TOD_HWP_EXECUTION_FAILED,
GETHUID(l_pMDMT->getTarget()));

l_failingTodProc = reinterpret_cast<TARGETING::Target*>(
l_fapiFailingProcTarget.get());

Expand Down

0 comments on commit 205f3c4

Please sign in to comment.