summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2017-06-06 15:39:40 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-23 10:29:55 -0400
commitc4dc9402e4237e5318c834f4535f6c1f58419951 (patch)
tree95b33383281d8863c6ae6ae2532947b07c7733cd /src
parentb22bfa0529a673baea56805fa4fcc1ba65c29666 (diff)
downloadtalos-hostboot-c4dc9402e4237e5318c834f4535f6c1f58419951.tar.gz
talos-hostboot-c4dc9402e4237e5318c834f4535f6c1f58419951.zip
Allow deconfig without a callout in error log.
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>
Diffstat (limited to 'src')
-rw-r--r--src/usr/diag/prdf/common/plugins/prdfLogParse_common.C1
-rw-r--r--src/usr/errl/errlentry.C7
-rw-r--r--src/usr/errl/plugins/errludcallout.H1
-rw-r--r--src/usr/errldisplay/errldisplay.C1
-rw-r--r--src/usr/fapi2/plat_utils.C3
-rw-r--r--src/usr/fapi2/test/fapi2VerifyCalloutTest.C94
-rw-r--r--src/usr/fapi2/test/fapi2VerifyCalloutTest.H13
-rw-r--r--src/usr/fapi2/test/rcSupport.C19
-rw-r--r--src/usr/fapi2/test/rcSupport.H8
9 files changed, 143 insertions, 4 deletions
diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
index 7bcdac465..773f6ef0c 100644
--- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
+++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
@@ -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;
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index 86d94396e..5c1c681a5 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -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;
}
@@ -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
diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H
index a1cb7dfe6..f13570ab3 100644
--- a/src/usr/errl/plugins/errludcallout.H
+++ b/src/usr/errl/plugins/errludcallout.H
@@ -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)
diff --git a/src/usr/errldisplay/errldisplay.C b/src/usr/errldisplay/errldisplay.C
index 305ddfd3d..590b20077 100644
--- a/src/usr/errldisplay/errldisplay.C
+++ b/src/usr/errldisplay/errldisplay.C
@@ -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)
diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C
index 39c20b7b1..b19d5880c 100644
--- a/src/usr/fapi2/plat_utils.C
+++ b/src/usr/fapi2/plat_utils.C
@@ -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)))
{
diff --git a/src/usr/fapi2/test/fapi2VerifyCalloutTest.C b/src/usr/fapi2/test/fapi2VerifyCalloutTest.C
index ca7238a6d..ed64b5690 100644
--- a/src/usr/fapi2/test/fapi2VerifyCalloutTest.C
+++ b/src/usr/fapi2/test/fapi2VerifyCalloutTest.C
@@ -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;
+}
diff --git a/src/usr/fapi2/test/fapi2VerifyCalloutTest.H b/src/usr/fapi2/test/fapi2VerifyCalloutTest.H
index eb52e7350..c5caf6ff1 100644
--- a/src/usr/fapi2/test/fapi2VerifyCalloutTest.H
+++ b/src/usr/fapi2/test/fapi2VerifyCalloutTest.H
@@ -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
diff --git a/src/usr/fapi2/test/rcSupport.C b/src/usr/fapi2/test/rcSupport.C
index 84ecb84e6..c78d1a9bd 100644
--- a/src/usr/fapi2/test/rcSupport.C
+++ b/src/usr/fapi2/test/rcSupport.C
@@ -156,6 +156,25 @@ fapi2::ReturnCode p9_deconfigCallout(
}
//******************************************************************************
+// 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
//******************************************************************************
diff --git a/src/usr/fapi2/test/rcSupport.H b/src/usr/fapi2/test/rcSupport.H
index e2e22fa3e..5c729879b 100644
--- a/src/usr/fapi2/test/rcSupport.H
+++ b/src/usr/fapi2/test/rcSupport.H
@@ -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
@@ -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<>
OpenPOWER on IntegriCloud