summaryrefslogtreecommitdiffstats
path: root/src/usr/errl
diff options
context:
space:
mode:
authorAndres Lugo-Reyes <aalugore@us.ibm.com>2015-05-05 13:14:27 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-06-19 16:00:51 -0500
commitef69ea46b6208625307bd42b2cf29beef10c8418 (patch)
tree1256d14ea7950e28714553f5503be2530bd04e9d /src/usr/errl
parent4d1c59f09b6b0ab9236aa42694cb2e42cbe8d3eb (diff)
downloadtalos-hostboot-ef69ea46b6208625307bd42b2cf29beef10c8418.tar.gz
talos-hostboot-ef69ea46b6208625307bd42b2cf29beef10c8418.zip
Add serial numbers/part numbers to err logs w/ hwcallouts
Change-Id: Ifef77c71f40e70136cdb5172ce653f7a5ebfdd10 RTC:122890 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16870 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rw-r--r--src/usr/errl/errlentry.C103
-rw-r--r--src/usr/errl/runtime/makefile2
2 files changed, 104 insertions, 1 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index 6c5245a7e..07dd5b78a 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -51,6 +51,7 @@
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
#include <config.h>
+#include <initservice/initserviceif.H>
// Hostboot Image ID string
@@ -518,6 +519,7 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target,
const HWAS::GARD_ErrorType i_gardErrorType)
{
+
if (i_target == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL)
{
#ifdef CONFIG_ERRL_ENTRY_TRACE
@@ -638,6 +640,7 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target,
ErrlUserDetailsCallout(&ep, size1,
i_priority, i_deconfigState, i_gardErrorType).addToLog(this);
+
}
if (i_gardErrorType != GARD_NULL)
{
@@ -685,6 +688,74 @@ void ErrlEntry::addHbBuildId()
}
///////////////////////////////////////////////////////////////////////////////
+// Called by addHwCallout to get the part and serial numbers from the current
+// target so that it can be appended to the error log
+void ErrlEntry::addPartAndSerialNumbersToErrLog
+ (const TARGETING::Target * i_target)
+{
+ TRACDCOMP(g_trac_errl, ENTER_MRK"ErrlEntry::addPartAndSerialNumbersToErrLog()");
+
+
+ // Get the type of the target
+ const TARGETING::Target * l_target = i_target;
+ TARGETING::TYPE l_type = l_target->getAttr<TARGETING::ATTR_TYPE>();
+
+ do
+ {
+ if((l_type != TARGETING::TYPE_PROC ) &&
+ (l_type != TARGETING::TYPE_DIMM ) &&
+ (l_type != TARGETING::TYPE_MEMBUF ))
+ {
+ TARGETING::PredicatePostfixExpr l_procDimmMembuf;
+ TARGETING::TargetHandleList l_pList;
+
+ TARGETING::PredicateCTM l_procs(TARGETING::CLASS_CHIP,
+ TARGETING::TYPE_PROC);
+
+ TARGETING::PredicateCTM l_dimms(TARGETING::CLASS_CARD,
+ TARGETING::TYPE_DIMM);
+
+ TARGETING::PredicateCTM l_membufs(TARGETING::CLASS_CHIP,
+ TARGETING::TYPE_MEMBUF);
+
+ l_procDimmMembuf.push(&l_procs).push(&l_dimms).Or()
+ .push(&l_membufs).Or();
+
+ // 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];
+ }
+
+ }
+ // 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);
+
+ }while( 0 );
+
+ TRACDCOMP(g_trac_errl, EXIT_MRK"ErrlEntry::addPartAndSerialNumbersToErrLog()");
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
// for use by ErrlManager
void ErrlEntry::commit( compId_t i_committerComponent )
{
@@ -708,6 +779,38 @@ void ErrlEntry::commit( compId_t i_committerComponent )
// Add the Hostboot Build ID to the error log
addHbBuildId();
+ // If this error was a hardware callout, add the serial and part numbers
+ // to the log. FSP provides this data so if there is no FSP, get them here.
+ if(!INITSERVICE::spBaseServicesEnabled())
+ {
+ for(size_t i = 0; i < iv_SectionVector.size(); i++)
+ {
+ ErrlUD * l_udSection = iv_SectionVector[i];
+ HWAS::callout_ud_t * l_ud =
+ reinterpret_cast<HWAS::callout_ud_t*>(l_udSection->iv_pData);
+
+ if((ERRL_COMP_ID == (l_udSection)->iv_header.iv_compId) &&
+ (1 == (l_udSection)->iv_header.iv_ver) &&
+ (ERRL_UDT_CALLOUT == (l_udSection)->iv_header.iv_sst) &&
+ (HWAS::HW_CALLOUT == l_ud->type))
+ {
+ uint8_t * l_uData = (uint8_t *)(l_ud + 1);
+ TARGETING::Target * l_target = NULL;
+
+ bool l_err = HWAS::retrieveTarget(l_uData,
+ l_target,
+ this);
+ if(!l_err)
+ {
+ addPartAndSerialNumbersToErrLog( l_target );
+ }
+ else
+ {
+ TRACFCOMP(g_trac_errl, "ErrlEntry::commit() - Error retrieving target");
+ }
+ }
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/usr/errl/runtime/makefile b/src/usr/errl/runtime/makefile
index 14212597f..c80c9fdaa 100644
--- a/src/usr/errl/runtime/makefile
+++ b/src/usr/errl/runtime/makefile
@@ -33,7 +33,7 @@ VPATH += ${ROOTPATH}/src/usr/hwas/common
OBJS += rt_errlmanager.o
OBJS += rt_vfs.o
-OBJS += $(if $(CONFIG_BMC_IPMI),hwasCallout.o)
+OBJS += hwasCallout.o
SUBDIRS += test.d
OpenPOWER on IntegriCloud