Skip to content

Commit

Permalink
Allow deconfig without a callout in error log.
Browse files Browse the repository at this point in the history
Change-Id: Ia2ce6f89b4fbc4bbafa355cb1da07bdbd360c317
RTC: 174701
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42085
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: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Jun 23, 2017
1 parent b22bfa0 commit c4dc940
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ bool parsePfaData( void * i_buffer, uint32_t i_buflen,
tmpStr = "Unknown Priority";
switch ( pfa.mruList[i].priority )
{
case HWAS::SRCI_PRIORITY_NONE: tmpStr = "NONE"; break;
case HWAS::SRCI_PRIORITY_LOW: tmpStr = "LOW"; break;
case HWAS::SRCI_PRIORITY_MEDC: tmpStr = "MED_C"; break;
case HWAS::SRCI_PRIORITY_MEDB: tmpStr = "MED_B"; break;
Expand Down
7 changes: 4 additions & 3 deletions src/usr/errl/errlentry.C
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ void ErrlEntry::setSubSystemIdBasedOnCallouts()
// figure out the highest priority callout, just grab
// the first one if there are several with the same
// priority.
if( highestPriorityCallout == NULL ||
( pData->priority > highestPriorityCallout->priority) )
if( (highestPriorityCallout == NULL) ||
(pData->priority > highestPriorityCallout->priority) )
{
highestPriorityCallout = pData;
}
Expand All @@ -789,7 +789,8 @@ void ErrlEntry::setSubSystemIdBasedOnCallouts()

// if this pointer is not null it will be pointing to the
// highest priority entry
if( highestPriorityCallout == NULL )
if((highestPriorityCallout == NULL) ||
(highestPriorityCallout->priority == HWAS::SRCI_PRIORITY_NONE) )
{
// no callouts in log, add default callout for hb code and
// add trace
Expand Down
1 change: 1 addition & 0 deletions src/usr/errl/plugins/errludcallout.H
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ case HWAS::_type: i_parser.PrintString( "Procedure", #_type); break;
{
#define case_PRIORITY(_type) \
case HWAS::_type: i_parser.PrintString( "Priority", #_type); break;
case_PRIORITY(SRCI_PRIORITY_NONE)
case_PRIORITY(SRCI_PRIORITY_LOW)
case_PRIORITY(SRCI_PRIORITY_MEDC)
case_PRIORITY(SRCI_PRIORITY_MEDB)
Expand Down
1 change: 1 addition & 0 deletions src/usr/errldisplay/errldisplay.C
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ case HWAS::_type: CONSOLE::displayf(NULL, " GARD Error Type : %s", #_t
{
#define case_PRIORITY(_type) \
case HWAS::_type: CONSOLE::displayf(NULL, " Priority : %s", #_type); break;
case_PRIORITY(SRCI_PRIORITY_NONE)
case_PRIORITY(SRCI_PRIORITY_LOW)
case_PRIORITY(SRCI_PRIORITY_MEDC)
case_PRIORITY(SRCI_PRIORITY_MEDB)
Expand Down
3 changes: 2 additions & 1 deletion src/usr/fapi2/plat_utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ HWAS::callOutPriority xlateCalloutPriority(

const HWAS::callOutPriority HWAS_PRI[] = {HWAS::SRCI_PRIORITY_LOW,
HWAS::SRCI_PRIORITY_MED,
HWAS::SRCI_PRIORITY_HIGH};
HWAS::SRCI_PRIORITY_HIGH,
HWAS::SRCI_PRIORITY_NONE};

if (l_index < (sizeof(HWAS_PRI)/sizeof(HWAS::callOutPriority)))
{
Expand Down
94 changes: 94 additions & 0 deletions src/usr/fapi2/test/fapi2VerifyCalloutTest.C
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,97 @@ uint32_t rcTestCalloutDeconfig()
FAPI_INF("rcTestCalloutDeconfig finished");
return l_result;
}

uint32_t rcTestCalloutNoneDeconfig()
{
uint32_t l_result = 0;
errlHndl_t l_errl = NULL;
bool l_hw_callout_found = false;

FAPI_INF("rcTestCalloutNoneDeconfig running");

TARGETING::TargetHandleList l_dimmList;
TARGETING::getAllLogicalCards(l_dimmList, TARGETING::TYPE_DIMM, false);
TARGETING::Target * l_Dimm = NULL;

//Take the first dimm
if (l_dimmList.size() > 0)
{
l_Dimm = l_dimmList[0];
}
else
{
TS_FAIL("No dimms found");
}

//Convert to fapi2 target for the HWP below
fapi2::Target<fapi2::TARGET_TYPE_DIMM> fapi2_dimmTarget(l_Dimm);

FAPI_INVOKE_HWP(l_errl, p9_deconfigCalloutNone, fapi2_dimmTarget);

if(l_errl != NULL)
{
FAPI_INF("rcTestCalloutNoneDeconfig: p9_deconfigCalloutNone "
"returned errl (expected)");

//Get the User Data fields of the errl. They are returned as
//vector<void*>, so iterate over them.
for( auto l_callout_raw : l_errl->
getUDSections( ERRL_COMP_ID, ERRORLOG::ERRL_UDT_CALLOUT ) )
{
HWAS::callout_ud_t* l_callout_entry =
reinterpret_cast<HWAS::callout_ud_t*>(l_callout_raw);

if(l_callout_entry->type == HWAS::HW_CALLOUT)
{
l_hw_callout_found = true;
FAPI_INF("rcTestCalloutNoneDeconfig: hw callout found");
if(l_callout_entry->deconfigState == HWAS::DELAYED_DECONFIG)
{
FAPI_INF("rcTestCalloutNoneDeconfig: Target is deconfigured");
}
else
{
TS_FAIL("rcTestCalloutNoneDeconfig: Target is NOT deconfigured");
l_result = 1;
break;
}
}
}
if(!l_hw_callout_found)
{
TS_FAIL("rcTestCalloutNoneDeconfig: hw callout NOT found");
l_result = 2;
}
}
else
{
TS_FAIL("rcTestCalloutNoneDeconfig: No error was returned from"
" p9_deconfigCalloutNone !!");
l_result = 3;
}

//l_errl->setSev(ERRORLOG::ERRL_SEV_RECOVERED);
//errlCommit(l_errl,CXXTEST_COMP_ID);
delete l_errl;
l_errl = NULL;

// Now try it the way HWP people do it
ReturnCode l_rc;
FAPI_EXEC_HWP(l_rc, p9_deconfigCalloutNone, fapi2_dimmTarget);
if (l_rc != fapi2::FAPI2_RC_SUCCESS)
{
// log the error but don't fail the unit test
FAPI_INF("rcTestCalloutNoneDeconfig: logError called");
fapi2::logError(l_rc, fapi2::FAPI2_ERRL_SEV_RECOVERED, true);
}
else
{
TS_FAIL("rcTestCalloutNoneDeconfig: No error was returned from "
"FAPI_EXEC_HWP p9_deconfigCalloutNone !!");
l_result = 4;
}

FAPI_INF("rcTestCalloutNoneDeconfig finished");
return l_result;
}
13 changes: 13 additions & 0 deletions src/usr/fapi2/test/fapi2VerifyCalloutTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,18 @@ public:
TS_FAIL("rcTestCalloutDeconfig. Fail l_res=%d", l_res);
}
}

/*
* @brief Test hw callout (none priority) with deconfig
*/
void testCalloutNoneDeconfig(void)
{
uint32_t l_res = rcTestCalloutNoneDeconfig();

if(l_res != 0)
{
TS_FAIL("rcTestCalloutNoneDeconfig. Fail l_res=%d", l_res);
}
}
};
#endif
19 changes: 19 additions & 0 deletions src/usr/fapi2/test/rcSupport.C
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ fapi2::ReturnCode p9_deconfigCallout(
return fapi2::current_err;
}

//******************************************************************************
// p9_deconfig_callout_none
// Force a test return code that deconfigures the target
//******************************************************************************
fapi2::ReturnCode p9_deconfigCalloutNone(
fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target)
{
FAPI_INF("Enter p9_deconfigCalloutNone...");

FAPI_ASSERT(0,
fapi2::TEST_ERROR_DECONFIG_NO_CALLOUT().set_TARGET(i_dimm_target));

fapi_try_exit:

FAPI_INF("Exiting p9_deconfigCalloutNone...");

return fapi2::current_err;
}

//******************************************************************************
// p9_procedureCallout
// Force a test return code that creates a procedure callout
Expand Down
8 changes: 8 additions & 0 deletions src/usr/fapi2/test/rcSupport.H
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ fapi2::ReturnCode p9_gardAndDeconfig(
fapi2::ReturnCode p9_deconfigCallout(
fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target);

//******************************************************************************
// p9_deconfigCalloutNone
// Force a test return code that deconfigures the target
//******************************************************************************
fapi2::ReturnCode p9_deconfigCalloutNone(
fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target);

//*****************************************************************************
// p9_procedureCallout
// Force a test return code that creates a procedure callout
Expand All @@ -85,6 +92,7 @@ fapi2::ReturnCode p9_procedureCallout();
fapi2::ReturnCode p9_hwCallout(
fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_core_target);


//****************************************************************************
// p9ErrorWithBuffer
// Force an error that will use a caller populated fapi2::buffer<>
Expand Down

0 comments on commit c4dc940

Please sign in to comment.