summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwas/common/deconfigGard.H25
-rw-r--r--src/include/usr/hwas/common/hwasCommon.H17
-rw-r--r--src/usr/hwas/common/deconfigGard.C80
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C12
4 files changed, 87 insertions, 47 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H
index d321c0113..2c974c9fb 100644
--- a/src/include/usr/hwas/common/deconfigGard.H
+++ b/src/include/usr/hwas/common/deconfigGard.H
@@ -77,10 +77,15 @@ class DeconfigGard
public:
- enum
- {
- CLEAR_ALL_GARD_RECORDS = EMPTY_GARD_RECORDID,
- GET_ALL_GARD_RECORDS = EMPTY_GARD_RECORDID,
+ // enums for events codes for Gard events
+ // used by platLogEvent() function
+ enum GardEvent
+ { // if GARD record:
+ GARD_APPLIED, // applied
+ MFG, // not applied due to MFG policy
+ PREDICTIVE, // not applied due to predictive policy
+ PREDICATE, // not applied due to predicate
+ GARD_NOT_APPLIED, // not applied for other reason
};
// enums to indicated non-error reason for a targets deconfiguration.
@@ -250,6 +255,18 @@ public:
/**
* @brief Platform specific function that
+ * logs a special trace event
+ *
+ * @param[in] i_pTarget Pointer to Target
+ * @param[in] i_eventType GardEvent enum
+ *
+ * @return errlHndl_t. Error log handle.
+ */
+ errlHndl_t platLogEvent(const TARGETING::Target * const i_pTarget,
+ const GardEvent i_eventType);
+
+ /**
+ * @brief Platform specific function that
* Creates a GARD Record for a Target.
*
* @param[in] i_pTarget Pointer to Target to create GARD Record for.
diff --git a/src/include/usr/hwas/common/hwasCommon.H b/src/include/usr/hwas/common/hwasCommon.H
index 9a3b6f70f..277f13b0a 100644
--- a/src/include/usr/hwas/common/hwasCommon.H
+++ b/src/include/usr/hwas/common/hwasCommon.H
@@ -197,23 +197,6 @@ errlHndl_t platGetFCO(
const TARGETING::TargetHandle_t &i_node,
uint32_t &o_fco);
-
-/**
- * @brief platform specific code to get the address in PNOR to read
- * and write GARD data
- *
- * @param[out] o_addr pointer to where GARD data is in PNOR
- * @param[out] o_size size (in bytes) of GARD data section in PNOR
- *
- * @return errlHndl_t valid errlHndl_t handle if there was an error
- * NULL if no errors;
- */
-errlHndl_t platGetGardPnorAddr(void *& o_addr,
- uint64_t &o_size);
-
-const uint32_t EMPTY_GARD_RECORDID=0xFFFFFFFF;
-const uint32_t EMPTY_GARD_VALUE=0xFF;
-
/**
* @brief wrapper function to create new errlog in platform-specific manner.
*
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index 6d63b44e7..ccdc4a1bc 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -98,7 +98,7 @@ errlHndl_t collectGard(const PredicateBase *i_pPredicate)
if (errl)
{
- HWAS_INF("collectGard failed (plid 0x%X)", errl->plid());
+ HWAS_ERR("collectGard failed (plid 0x%X)", errl->plid());
}
else
{
@@ -144,11 +144,10 @@ errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
do
{
GardRecords_t l_gardRecords;
-
l_pErr = platGetGardRecords(NULL, l_gardRecords);
if (l_pErr)
{
- HWAS_ERR("Error 0x%X from platGetGardRecords", l_pErr->plid());
+ HWAS_ERR("Error from platGetGardRecords");
break;
}
@@ -190,8 +189,7 @@ errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
l_pErr = platClearGardRecords(l_pTarget);
if (l_pErr)
{
- HWAS_ERR("Error 0x%X from platClearGardRecords",
- l_pErr->plid());
+ HWAS_ERR("Error from platClearGardRecords");
break;
}
} // for
@@ -212,7 +210,7 @@ errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
while (0);
return l_pErr;
-}
+} // clearGardRecordsForReplacedTargets
//******************************************************************************
errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
@@ -220,7 +218,6 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
{
HWAS_INF("Deconfigure Targets from GARD Records for IPL");
errlHndl_t l_pErr = NULL;
- GardRecords_t l_gardRecords;
do
{
@@ -236,24 +233,25 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
// manufacturing records are disabled
// - don't process
HWAS_INF("Manufacturing policy: disabled - skipping GARD Records");
+ l_pErr = platLogEvent(NULL, MFG);
+ if (l_pErr)
+ {
+ HWAS_ERR("platLogEvent returned an error");
+ }
break;
}
// Get all GARD Records
+ GardRecords_t l_gardRecords;
l_pErr = platGetGardRecords(NULL, l_gardRecords);
if (l_pErr)
{
- HWAS_ERR("Error 0x%X from platGetGardRecords", l_pErr->plid());
+ HWAS_ERR("Error from platGetGardRecords");
break;
}
HWAS_DBG("%d GARD Records found", l_gardRecords.size());
- if (l_gardRecords.empty())
- {
- break;
- }
-
// For each GARD Record
for (GardRecordsCItr_t l_itr = l_gardRecords.begin();
l_itr != l_gardRecords.end();
@@ -261,15 +259,6 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
{
GardRecord l_gardRecord = *l_itr;
- if ((l_sys_policy & CDM_POLICIES_PREDICTIVE_DISABLED) &&
- (l_gardRecord.iv_errorType == GARD_Predictive))
- {
- // predictive records are disabled AND gard record is predictive
- // - don't process
- HWAS_INF("Predictive policy: disabled - skipping GARD Record");
- continue;
- }
-
// Find the associated Target
Target * l_pTarget =
targetService().toTarget(l_gardRecord.iv_targetId);
@@ -288,6 +277,27 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
{
HWAS_INF("skipping %.8X - predicate didn't match",
get_huid(l_pTarget));
+ l_pErr = platLogEvent(l_pTarget, PREDICATE);
+ if (l_pErr)
+ {
+ HWAS_ERR("platLogEvent returned an error");
+ break;
+ }
+ continue;
+ }
+
+ if ((l_sys_policy & CDM_POLICIES_PREDICTIVE_DISABLED) &&
+ (l_gardRecord.iv_errorType == GARD_Predictive))
+ {
+ // predictive records are disabled AND gard record is predictive
+ // - don't process
+ HWAS_INF("Predictive policy: disabled - skipping GARD Record");
+ l_pErr = platLogEvent(l_pTarget, PREDICTIVE);
+ if (l_pErr)
+ {
+ HWAS_ERR("platLogEvent returned an error");
+ break;
+ }
continue;
}
@@ -296,6 +306,12 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
{
HWAS_INF("skipping %.8X - target not present",
get_huid(l_pTarget));
+ l_pErr = platLogEvent(l_pTarget, GARD_NOT_APPLIED);
+ if (l_pErr)
+ {
+ HWAS_ERR("platLogEvent returned an error");
+ break;
+ }
continue;
}
@@ -316,14 +332,26 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
_deconfigureByAssoc(*l_pTarget, l_errlogEid);
HWAS_MUTEX_UNLOCK(iv_mutex);
+
+ l_pErr = platLogEvent(l_pTarget, GARD_APPLIED);
+ if (l_pErr)
+ {
+ HWAS_ERR("platLogEvent returned an error");
+ break;
+ }
} // for
+ if (l_pErr)
+ {
+ break;
+ }
+
// Deconfigure procs based on fabric bus deconfigs and perform SMP
// node balancing
l_pErr = _invokeDeconfigureAssocProc();
- if ( l_pErr )
+ if (l_pErr)
{
- HWAS_ERR("Error from _invokeDeconfigureAssocProc ");
+ HWAS_ERR("Error from _invokeDeconfigureAssocProc");
break;
}
}
@@ -332,10 +360,10 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
return l_pErr;
} // deconfigureTargetsFromGardRecordsForIpl
+//******************************************************************************
bool compareTargetHuid(TargetHandle_t t1, TargetHandle_t t2)
{
- return (t1->getAttr<ATTR_HUID>() <
- t2->getAttr<ATTR_HUID>());
+ return (t1->getAttr<ATTR_HUID>() < t2->getAttr<ATTR_HUID>());
}
//******************************************************************************
diff --git a/src/usr/hwas/hwasPlatDeconfigGard.C b/src/usr/hwas/hwasPlatDeconfigGard.C
index 5f658235b..3f1a330a0 100644
--- a/src/usr/hwas/hwasPlatDeconfigGard.C
+++ b/src/usr/hwas/hwasPlatDeconfigGard.C
@@ -47,9 +47,21 @@ namespace HWAS
using namespace HWAS::COMMON;
using namespace TARGETING;
+const uint32_t EMPTY_GARD_RECORDID = 0xFFFFFFFF;
+
void _flush(void *i_addr);
errlHndl_t _GardRecordIdSetup(void *&io_platDeconfigGard);
+errlHndl_t DeconfigGard::platLogEvent(
+ const Target * const i_pTarget,
+ const GardEvent i_eventType)
+{
+ errlHndl_t l_pErr = NULL;
+ HWAS_DBG("LogEvent %d", i_eventType);
+
+ return l_pErr;
+}
+
errlHndl_t DeconfigGard::platClearGardRecords(
const Target * const i_pTarget)
{
OpenPOWER on IntegriCloud