summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/errl/errlentry.H10
-rw-r--r--src/include/usr/hwas/common/hwasCallout.H3
-rw-r--r--src/usr/errl/errlentry.C197
-rw-r--r--src/usr/errl/errlentry_consts.H8
4 files changed, 132 insertions, 86 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index a41cb7bcf..fea1a76ef 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -860,17 +860,15 @@ private:
*/
void addVersionInfo(void);
-#ifdef CONFIG_BMC_IPMI
/**
- * @brief called by addHwCallout to retrieve the serial and part number
- * from the current target. If the current target does not contain
- * ATTR_PART_NUMBER or ATTR_SERIAL_NUMBER, find the first parent that does
- * and adds the attribute to the error log.
+ * @brief called by addHwCallout to retrieve various pieces of card
+ * and/or chip data, e.g. part number, serial number, ecid.
*
* @param[in] i_target The target to get the numbers for
*/
- void addPartAndSerialNumbersToErrLog(const TARGETING::Target * i_target);
+ void addPartIdInfoToErrLog(const TARGETING::Target * i_target);
+#ifdef CONFIG_BMC_IPMI
/**
* @brief called by addHwCallout to retrieve the FRU ID and sensor ID
* from the current target. If the current target does not contain
diff --git a/src/include/usr/hwas/common/hwasCallout.H b/src/include/usr/hwas/common/hwasCallout.H
index a39e4a229..9c11236df 100644
--- a/src/include/usr/hwas/common/hwasCallout.H
+++ b/src/include/usr/hwas/common/hwasCallout.H
@@ -186,7 +186,8 @@ enum busTypeEnum
X_BUS_TYPE = 4,
I2C_BUS_TYPE = 5,
PSI_BUS_TYPE = 6,
- O_BUS_TYPE = 7
+ O_BUS_TYPE = 7,
+ OMI_BUS_TYPE = 8,
};
// Used by Hostboot code where real clock targets do not exist
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index 8effbc598..06f9d92a3 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -588,34 +588,6 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target,
#endif
TARGETING::EntityPath ep;
- TARGETING::TYPE l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();
-
- TARGETING::TYPE l_type_ecid = l_type;
- const TARGETING::Target* l_parentTarget = i_target;
- if((l_type_ecid != TARGETING::TYPE_MEMBUF) &&
- (l_type_ecid != TARGETING::TYPE_PROC) &&
- (l_type_ecid != TARGETING::TYPE_NODE)
- )
- {
- //since this returns NULL if the parent is not found,
- // we need a placeholder
- const TARGETING::Target* l_tempParentTarget =
- getParentChip(l_parentTarget);
- if(l_tempParentTarget != NULL)
- {
- l_parentTarget = l_tempParentTarget;
- l_type_ecid = l_parentTarget->getAttr<TARGETING::ATTR_TYPE>();
- }
- }
- //if we have found a type_membuf or type_proc, store the ecid
- //otherwise, (type_node), do nothing.
- if(l_type_ecid == TARGETING::TYPE_MEMBUF ||
- l_type_ecid == TARGETING::TYPE_PROC)
- {
- ErrlUserDetailsAttribute(l_parentTarget,
- TARGETING::ATTR_ECID).addToLog(this);
- }
-
ep = i_target->getAttr<TARGETING::ATTR_PHYS_PATH>();
// size is total EntityPath size minus unused path elements
@@ -928,75 +900,142 @@ void ErrlEntry::checkHiddenLogsEnable( )
}
///////////////////////////////////////////////////////////////////////////////
-// Called by addHwCallout to get the part and serial numbers from the current
-// target so that it can be appended to the error log
-#ifdef CONFIG_BMC_IPMI
- void ErrlEntry::addPartAndSerialNumbersToErrLog
-(const TARGETING::Target * i_target)
+// Called by addHwCallout to retrieve various pieces of card
+// and/or chip data, e.g. part number, serial number, ecid.
+void ErrlEntry::addPartIdInfoToErrLog
+ (const TARGETING::Target * i_target)
{
- TRACDCOMP(g_trac_errl, ENTER_MRK"ErrlEntry::addPartAndSerialNumbersToErrLog()");
-
+ TRACDCOMP(g_trac_errl, ENTER_MRK"ErrlEntry::addPartIdInfoToErrLog()");
- // Get the type of the target
const TARGETING::Target * l_target = i_target;
- TARGETING::TYPE l_type = l_target->getAttr<TARGETING::ATTR_TYPE>();
+ const TARGETING::Target * l_targetPrev = nullptr;
+ ErrlUserDetailsAttribute* l_attrdata = nullptr;
- do
+ //Add the part number to the error log.
+ TARGETING::TargetHandleList l_parentList;
+ TARGETING::ATTR_PART_NUMBER_type l_PN = {};
+ while( !l_target->tryGetAttr<TARGETING::ATTR_PART_NUMBER>(l_PN) )
{
- if((l_type != TARGETING::TYPE_PROC ) &&
- (l_type != TARGETING::TYPE_DIMM ) &&
- (l_type != TARGETING::TYPE_MEMBUF ))
+ // Get immediate parent
+ TARGETING::targetService().getAssociated(
+ l_parentList,
+ l_target,
+ TARGETING::TargetService::PARENT,
+ TARGETING::TargetService::IMMEDIATE);
+
+ // never found a match...
+ if (l_parentList.size() != 1)
{
- TARGETING::PredicatePostfixExpr l_procDimmMembuf;
- TARGETING::TargetHandleList l_pList;
+ l_target = nullptr;
+ break;
+ }
- TARGETING::PredicateCTM l_procs(TARGETING::CLASS_CHIP,
- TARGETING::TYPE_PROC);
+ l_target = l_parentList[0];
+ l_parentList.clear(); // clear out old entry
+ } // end while
+ if( l_target )
+ {
+ l_attrdata = new ErrlUserDetailsAttribute(l_target);
+ l_attrdata->addData(TARGETING::ATTR_PART_NUMBER);
+ l_targetPrev = l_target;
+ }
- TARGETING::PredicateCTM l_dimms(TARGETING::CLASS_CARD,
- TARGETING::TYPE_DIMM);
+ // Note - it is extremely likely that we will end up with the same
+ // target for PN and SN, but since this is error path only we're
+ // opting for thoroughness over efficiency.
- TARGETING::PredicateCTM l_membufs(TARGETING::CLASS_CHIP,
- TARGETING::TYPE_MEMBUF);
+ //Add the serial number to the error log.
+ l_target = i_target;
+ TARGETING::ATTR_SERIAL_NUMBER_type l_SN = {};
+ while( !l_target->tryGetAttr<TARGETING::ATTR_SERIAL_NUMBER>(l_SN) )
+ {
+ // Get immediate parent
+ TARGETING::targetService().getAssociated(
+ l_parentList,
+ l_target,
+ TARGETING::TargetService::PARENT,
+ TARGETING::TargetService::IMMEDIATE);
- l_procDimmMembuf.push(&l_procs).push(&l_dimms).Or()
- .push(&l_membufs).Or();
+ // never found a match...
+ if (l_parentList.size() != 1)
+ {
+ l_target = nullptr;
+ break;
+ }
- // Search for any parents with TYPE_PROC, TYPE_DIMM, or TYPE_MEMBUF
- TARGETING::targetService().getAssociated( l_pList, l_target,
- TARGETING::TargetService::PARENT,
- TARGETING::TargetService::ALL,
- &l_procDimmMembuf);
- // If no parent of desired type is present, break
- if(!l_pList.size())
- {
- TRACFCOMP(g_trac_errl, "Error! errlentry.C::addPartAndSerialNumbersToErrLog - No parent containing Serial/Part numbers found.");
- break;
- }
- else
- {
- // We have found the parent
- l_target = l_pList[0];
- }
+ l_target = l_parentList[0];
+ l_parentList.clear(); // clear out old entry
+ } // end while
+ if( l_target )
+ {
+ // not likely to happen, but just in case...
+ if( l_attrdata && (l_targetPrev != l_target) )
+ {
+ // got a new target, commit the previous data and start over
+ l_attrdata->addToLog(this);
+ delete l_attrdata;
+ l_attrdata = nullptr;
+ }
+ if( !l_attrdata )
+ {
+ l_attrdata = new ErrlUserDetailsAttribute(l_target);
+ }
+
+ l_attrdata->addData(TARGETING::ATTR_SERIAL_NUMBER);
+ l_targetPrev = l_target;
+ }
+
+ //Add the ECID to the error log.
+ l_target = i_target;
+ TARGETING::ATTR_ECID_type l_ECID = {};
+ while( !l_target->tryGetAttr<TARGETING::ATTR_ECID>(l_ECID) )
+ {
+ // Get immediate parent
+ TARGETING::targetService().getAssociated(
+ l_parentList,
+ l_target,
+ TARGETING::TargetService::PARENT,
+ TARGETING::TargetService::IMMEDIATE);
+ // never found a match...
+ if (l_parentList.size() != 1)
+ {
+ l_target = nullptr;
+ break;
}
- // We have made it here so we have found a target that contains
- // ATTR_SERIAL_NUMBER and ATTR_PART_NUMBER
- //Add the part number to the error log.
- ErrlUserDetailsAttribute( l_target,
- TARGETING::ATTR_PART_NUMBER).addToLog(this);
- //Add the serial number to the error log.
- ErrlUserDetailsAttribute( l_target,
- TARGETING::ATTR_SERIAL_NUMBER).addToLog(this);
+ l_target = l_parentList[0];
+ l_parentList.clear(); // clear out old entry
+ } // end while
+ if( l_target )
+ {
+ // not likely to happen, but just in case...
+ if( l_attrdata && (l_targetPrev != l_target) )
+ {
+ // got a new target, commit the previous data and start over
+ l_attrdata->addToLog(this);
+ delete l_attrdata;
+ l_attrdata = nullptr;
+ }
+ if( !l_attrdata )
+ {
+ l_attrdata = new ErrlUserDetailsAttribute(l_target);
+ }
+ l_attrdata->addData(TARGETING::ATTR_ECID);
+ l_targetPrev = l_target;
+ }
- }while( 0 );
+ if( l_attrdata )
+ {
+ l_attrdata->addToLog(this);
+ delete l_attrdata;
+ }
- TRACDCOMP(g_trac_errl, EXIT_MRK"ErrlEntry::addPartAndSerialNumbersToErrLog()");
+ TRACDCOMP(g_trac_errl, EXIT_MRK"ErrlEntry::addPartIdInfoToErrLog()");
}
-
+#ifdef CONFIG_BMC_IPMI
// Find the FRU ID associated with target.
// Returns first FRU ID found as it navigates the target's parent hierarchy
TARGETING::ATTR_FRU_ID_type getFRU_ID(TARGETING::Target * i_target)
@@ -1135,8 +1174,8 @@ void ErrlEntry::commit( compId_t i_committerComponent )
this);
if(!l_err)
{
+ addPartIdInfoToErrLog( l_target );
#ifdef CONFIG_BMC_IPMI
- addPartAndSerialNumbersToErrLog( l_target );
addSensorDataToErrLog( l_target, l_ud->priority);
#endif
}
diff --git a/src/usr/errl/errlentry_consts.H b/src/usr/errl/errlentry_consts.H
index 205b4ce7c..86d58a77c 100644
--- a/src/usr/errl/errlentry_consts.H
+++ b/src/usr/errl/errlentry_consts.H
@@ -102,6 +102,13 @@ const epubTargetTypeToSub_t TARGET_TO_SUBSYS_TABLE[] =
{ TARGETING::TYPE_TPM , EPUB_CEC_HDW_SUBSYS },
{ TARGETING::TYPE_MC , EPUB_MEMORY_SUBSYS },
{ TARGETING::TYPE_SMPGROUP , EPUB_CEC_HDW_SUBSYS },
+ { TARGETING::TYPE_OMI , EPUB_MEMORY_SUBSYS },
+ { TARGETING::TYPE_MCC , EPUB_MEMORY_SUBSYS },
+ { TARGETING::TYPE_OMIC , EPUB_MEMORY_SUBSYS },
+ { TARGETING::TYPE_OCMB_CHIP , EPUB_MEMORY_SUBSYS },
+ { TARGETING::TYPE_MEM_PORT , EPUB_MEMORY_SUBSYS },
+ { TARGETING::TYPE_I2C_MUX , EPUB_CEC_HDW_SUBSYS },
+ { TARGETING::TYPE_PMIC , EPUB_MEMORY_SUBSYS },
};
struct epubBusTypeToSub_t
@@ -119,6 +126,7 @@ const epubBusTypeToSub_t BUS_TO_SUBSYS_TABLE[] =
{ HWAS::I2C_BUS_TYPE , EPUB_CEC_HDW_I2C_DEVS },
{ HWAS::PSI_BUS_TYPE , EPUB_CEC_HDW_SP_PHYP_INTF },
{ HWAS::O_BUS_TYPE , EPUB_PROCESSOR_BUS_CTL },
+ { HWAS::OMI_BUS_TYPE , EPUB_MEMORY_BUS },
};
struct epubClockTypeToSub_t
OpenPOWER on IntegriCloud