summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/errl/test/errltest.H140
-rw-r--r--src/usr/hwas/hwasPlatCallout.C126
2 files changed, 209 insertions, 57 deletions
diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H
index 9dace8d04..eb756f4f0 100644
--- a/src/usr/errl/test/errltest.H
+++ b/src/usr/errl/test/errltest.H
@@ -933,7 +933,147 @@ public:
while(0);
#endif
}
+ /**
+ * @brief Test No Gard on Informational error logs
+ */
+ void testdeconfigNoGardInformational()
+ {
+#if 1
+ // these tests deconfigure and gard targets. and even tho they
+ // restore their state after the tests, since the cxxtests are
+ // all run in parallel, during the time that a target is non-
+ // functional due to this test, another test may be running that
+ // might be adversly affected.
+ // tests are left in the code so that a developer can enable them
+ // to test these specific functions - just keep in mind that there
+ // could be side effects in other cxxtests.
+ TS_TRACE( " - SKIPPING -- other tests could be adversly affected");
+#else
+ do
+ {
+ // find a ex unit that we can play with
+ TARGETING::Target * pSys;
+ TARGETING::targetService().getTopLevelTarget(pSys);
+
+ TARGETING::PredicateCTM predEx(TARGETING::CLASS_UNIT, TARGETING::TYPE_EX);
+ TARGETING::PredicateHwas predFunctional;
+ predFunctional.poweredOn(true).present(true).functional(true);
+ TARGETING::PredicatePostfixExpr checkExpr;
+ checkExpr.push(&predEx).push(&predFunctional).And();
+ TARGETING::TargetHandleList pExList;
+ TARGETING::targetService().getAssociated( pExList, pSys,
+ TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &checkExpr );
+
+ if (pExList.empty())
+ {
+ TS_FAIL("testdeconfigNoGardInformational: empty pExList");
+ break;
+ }
+
+ errlHndl_t errl = NULL;
+ HWAS::DeconfigGard::DeconfigureRecords_t l_deconfigRecords;
+ HWAS::DeconfigGard::GardRecords_t l_gardRecords;
+ HWAS::DeconfigGard::DeconfigureRecords_t l_deconfigRecordsAfter;
+ HWAS::DeconfigGard::GardRecords_t l_gardRecordsAfter;
+ // make sure there aren't any existing deconfigure or gard records
+ errl = HWAS::theDeconfigGard()._getDeconfigureRecords(NULL,
+ l_deconfigRecords);
+ if (errl)
+ {
+ TS_FAIL("testdeconfigNoGardInformational: Error from "
+ "_getDeconfigureRecords");
+ errlCommit(errl,HWAS_COMP_ID);
+ break;
+ }
+ if (l_deconfigRecords.size() != 0)
+ {
+ TS_INFO("testdeconfigNoGardInformational: %d existing "
+ "Deconfigure Records, skipping test",
+ l_deconfigRecords.size());
+ break;
+ }
+
+ errl = HWAS::theDeconfigGard().getGardRecords(
+ NULL, l_gardRecords);
+ if (errl)
+ {
+ TS_FAIL("testdeconfigNoGardInformational: Error from "
+ "getGardRecords");
+ errlCommit(errl,HWAS_COMP_ID);
+ break;
+ }
+ if (l_gardRecords.size() != 0)
+ {
+ TS_INFO("testdeconfigNoGardInformational: %d existing "
+ "GARD Records, skipping test", l_gardRecords.size());
+ break;
+ }
+
+ errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ ERRORLOG::ERRL_TEST_MOD_ID,
+ ERRORLOG::ERRL_TEST_REASON_CODE);
+
+
+ // Part callout using deconfig/GARD parameters
+ errl->addHwCallout(
+ pExList[0],
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_Fatal);
+
+ errlCommit(errl, CXXTEST_COMP_ID);
+
+ // Flush out errorlogs so we make sure deconfigs/gards are logged
+ // before we check for them
+ ERRORLOG::ErrlManager::callFlushErrorLogs();
+
+ // Check gard and deconfigs - should be none.
+ errlHndl_t gard_errl = NULL;
+
+ gard_errl = HWAS::theDeconfigGard()._getDeconfigureRecords(NULL,
+ l_deconfigRecordsAfter);
+
+ if (gard_errl)
+ {
+ TS_FAIL("testdeconfigNoGardInformational: Error from "
+ "_getDeconfigureRecords - post deconfigs");
+ errlCommit(errl,HWAS_COMP_ID);
+ break;
+ }
+ if (l_deconfigRecordsAfter.size() != l_deconfigRecords.size())
+ {
+ TS_INFO("testdeconfigNoGardInformational: %d "
+ "Deconfigure Records, expecting none. TEST FAILED",
+ l_deconfigRecordsAfter.size());
+ TS_FAIL("testdeconfigNoGardInformational: Deconfig records "
+ "present, expecting none.");
+ break;
+ }
+
+ gard_errl = HWAS::theDeconfigGard().getGardRecords(
+ NULL, l_gardRecordsAfter);
+
+ if (gard_errl)
+ {
+ TS_FAIL("testdeconfigNoGardInformational: Error from "
+ "getGardRecords - post deconfigs");
+ errlCommit(errl,HWAS_COMP_ID);
+ break;
+ }
+ if (l_gardRecords.size() != l_gardRecordsAfter.size())
+ {
+ TS_INFO("testdeconfigNoGardInformational: %d GARD Records "
+ "present, expecting none. TEST FAILED",
+ l_gardRecordsAfter.size());
+ TS_FAIL("testdeconfigNoGardInformational: GARD records "
+ "present, expecting none.");
+ break;
+ }
+ }while(0);
+#endif
+ }
};
}
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
index 03756a85f..7d7182e87 100644
--- a/src/usr/hwas/hwasPlatCallout.C
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -82,6 +82,10 @@ errlHndl_t platHandleHWCallout(
{
HWAS_INF("hwasPLDDetection return true - skipping callouts");
}
+ else if ((io_errl->sev()) == (ERRORLOG::ERRL_SEV_INFORMATIONAL))
+ {
+ HWAS_INF("Error log is informational - skipping callouts");
+ }
else
{
switch (i_gardErrorType)
@@ -182,79 +186,87 @@ errlHndl_t platHandleClockCallout(
errlHndl_t pError = NULL;
+ if ((io_errl->sev()) == (ERRORLOG::ERRL_SEV_INFORMATIONAL))
+ {
+ HWAS_INF("Error log is informational - skipping clock callouts");
+ }
+ else
+ {
#ifdef CONFIG_BMC_IPMI
- // If BMC is present and IPMI is configured system has a simple clock
- // topology, so need to update the BMC fault sensor for the clock if there
- // is a deconfig since Hostboot is the only party able to handle clock
- // fails.
- // For now, all clock sensors reside on the node target
- if(i_deconfigState == HWAS::DECONFIG)
- {
- TARGETING::TargetHandleList parentList;
+ // If BMC is present and IPMI is configured system has a simple clock
+ // topology, so need to update the BMC fault sensor for the clock if
+ // there is a deconfig since Hostboot is the only party able to handle
+ // clock fails.
+ // For now, all clock sensors reside on the node target
+ if(i_deconfigState == HWAS::DECONFIG)
+ {
+ TARGETING::TargetHandleList parentList;
- (void)getParentAffinityTargets (
- parentList,
- i_pTarget, TARGETING::CLASS_ENC, TARGETING::TYPE_NODE,
- false);
+ (void)getParentAffinityTargets (
+ parentList,
+ i_pTarget, TARGETING::CLASS_ENC, TARGETING::TYPE_NODE,
+ false);
- assert(parentList.size() == 1, "Bug! Query returned multiple or no "
- "(actual = %d) parents",
- parentList.size());
+ assert(parentList.size() == 1, "Bug! Query returned multiple or no "
+ "(actual = %d) parents",
+ parentList.size());
- TARGETING::TargetHandle_t pTarget = parentList[0];
+ TARGETING::TargetHandle_t pTarget = parentList[0];
- // Get associated target
- TARGETING::ENTITY_ID associatedType = TARGETING::ENTITY_ID_NA;
- switch(i_clockType)
- {
- case TODCLK_TYPE:
- associatedType = TARGETING::ENTITY_ID_TOD_CLOCK;
- break;
- case MEMCLK_TYPE:
- case OSCREFCLK_TYPE:
- associatedType = TARGETING::ENTITY_ID_REF_CLOCK;
- break;
- case OSCPCICLK_TYPE:
- associatedType = TARGETING::ENTITY_ID_PCI_CLOCK;
- break;
- default:
- assert(0,"Bug! Caller supplied illegal clock type. "
- "i_clockType = 0x%X",
- i_clockType);
- }
+ // Get associated target
+ TARGETING::ENTITY_ID associatedType = TARGETING::ENTITY_ID_NA;
+ switch(i_clockType)
+ {
+ case TODCLK_TYPE:
+ associatedType = TARGETING::ENTITY_ID_TOD_CLOCK;
+ break;
+ case MEMCLK_TYPE:
+ case OSCREFCLK_TYPE:
+ associatedType = TARGETING::ENTITY_ID_REF_CLOCK;
+ break;
+ case OSCPCICLK_TYPE:
+ associatedType = TARGETING::ENTITY_ID_PCI_CLOCK;
+ break;
+ default:
+ assert(0,"Bug! Caller supplied illegal clock type. "
+ "i_clockType = 0x%X",
+ i_clockType);
+ }
- SENSOR::FaultSensor faultSensor(pTarget,associatedType);
+ SENSOR::FaultSensor faultSensor(pTarget,associatedType);
- pError = faultSensor.setStatus(
- SENSOR::FaultSensor::FAULT_STATE_ASSERTED);
- if(pError)
- {
- HWAS_ERR("Failed setting fault sensor status for clock type 0x%X "
- "and HUID 0x%X",
- i_clockType, TARGETING::get_huid(pTarget));
- pError->collectTrace(HWAS_COMP_NAME, 512);
- errlCommit(pError, HWAS_COMP_ID);
+ pError = faultSensor.setStatus(
+ SENSOR::FaultSensor::FAULT_STATE_ASSERTED);
+ if(pError)
+ {
+ HWAS_ERR("Failed setting fault sensor status for clock type "
+ "0x%X and HUID 0x%X",
+ i_clockType, TARGETING::get_huid(pTarget));
+ pError->collectTrace(HWAS_COMP_NAME, 512);
+ errlCommit(pError, HWAS_COMP_ID);
+ }
}
- }
#endif
#ifdef CONFIG_CLOCK_DECONFIGS_FATAL
- // If clock deconfigs are considered fatal, and deconfig requested, then
- // call doShutdown
- if(i_deconfigState == HWAS::DECONFIG)
- {
- HWAS_INF(
- "Clock deconfiguration considered fatal, requesting "
- "shutdown. See PLID = 0x%X for details.",
- io_errl->plid());
- INITSERVICE::doShutdown(io_errl->plid(), true);
- }
+ // If clock deconfigs are considered fatal, and deconfig requested, then
+ // call doShutdown
+ if(i_deconfigState == HWAS::DECONFIG)
+ {
+ HWAS_INF(
+ "Clock deconfiguration considered fatal, requesting "
+ "shutdown. See PLID = 0x%X for details.",
+ io_errl->plid());
+ INITSERVICE::doShutdown(io_errl->plid(), true);
+ }
#endif
+ }
+
return pError;
}
OpenPOWER on IntegriCloud