summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2018-01-22 11:15:33 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2018-01-25 16:43:33 -0500
commit2935800fa74d6c18c77b322b45930d250ab47be7 (patch)
treecb0085c0f9fc804394f8cdee0cf882ee89d4bafd /src
parentafa7087e71fedb6d50b8874231420449834e7d1b (diff)
downloadtalos-hostboot-2935800fa74d6c18c77b322b45930d250ab47be7.tar.gz
talos-hostboot-2935800fa74d6c18c77b322b45930d250ab47be7.zip
PRD: generic solution to associate HWP failures with PRD isolation
Change-Id: Id5a767cc2475e4a7cc2003eeb74af6c07369315a CQ: SW413495 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52285 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> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/diag/attn/ipl/attn.C102
-rw-r--r--src/usr/fapi2/plat_utils.C110
-rw-r--r--src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C43
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml6
4 files changed, 47 insertions, 214 deletions
diff --git a/src/usr/diag/attn/ipl/attn.C b/src/usr/diag/attn/ipl/attn.C
index 60acbc328..7d59a3965 100644
--- a/src/usr/diag/attn/ipl/attn.C
+++ b/src/usr/diag/attn/ipl/attn.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2017 */
+/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -135,102 +135,40 @@ errlHndl_t checkForIplAttentions()
// NOTE: There could be multiple PLIDs set on different targets
// So we may need to commit some elogs and pass back one.
// ====================================================================
- ATTR_MODEL_type l_model = l_MasterProcTarget->getAttr<ATTR_MODEL>();
- errlHndl_t l_plidElog = NULL;
- uint32_t l_plid = 0;
- TARGETING::TYPE l_memType;
- TargetHandleList l_allProcsList, l_memList;
+ errlHndl_t l_plidElog = nullptr;
- // Setup appropriate memory type target
- if ( MODEL_NIMBUS == l_model )
+ // Iterate all targets.
+ for ( TargetIterator trgt = TARGETING::targetService().begin();
+ trgt != TARGETING::targetService().end(); ++trgt )
{
- l_memType = TYPE_MCA;
- } // if NIMBUS
- else if ( MODEL_CUMULUS == l_model )
- {
- l_memType = TYPE_DMI;
- } // if CUMULUS
- else
- {
- ATTN_ERR("ChkForIplAttns Unknown PROC type - add support");
- assert(0);
- } // UNKNOWN proc type
+ uint32_t l_plid = 0;
-
- // This gets all PROCs whether functional or not
- getTargetService().getAllChips(l_allProcsList, TYPE_PROC, false);
-
- // Loop thru all PROC targets
- for ( auto l_procTarg : l_allProcsList )
- {
- // check PROC target first for attribute
- l_procTarg->tryGetAttr<ATTR_PRD_HWP_PLID>(l_plid);
-
- if (0 != l_plid)
+ // Check for non-zero value in PLID attribute.
+ if ( (*trgt)->tryGetAttr<ATTR_PRD_HWP_PLID>(l_plid) && (0 != l_plid) )
{
- ATTN_SLOW("checkForIplAttentions PROC plid found");
+ ATTN_SLOW( "ATTR_PRD_HWP_PLID found on 0x%08x with value 0x%08x",
+ get_huid(*trgt), l_plid );
- // If we had a prior ELOG, we need to commit it
- // since we will be creating another one here.
- if (NULL != l_plidElog)
+ // In the case where there is more than one target with this
+ // attribute, commit the previous error log.
+ if ( nullptr != l_plidElog )
{
- errlCommit(l_plidElog, ATTN_COMP_ID);
+ errlCommit( l_plidElog, ATTN_COMP_ID );
}
- // Build elog with same PLID value
+ // Create a new error log and link the PLID.
l_plidElog = new ErrlEntry( ERRL_SEV_UNRECOVERABLE,
ATTN_CHK_IPL_ATTNS_MODULE,
ATTN_SEE_HW_ERROR,
- l_plid, TYPE_PROC
- );
-
- // Make sure PLID matches the HW error
+ get_huid(*trgt), l_plid );
l_plidElog->plid(l_plid);
- // clear attribute
- l_plid = 0;
- l_procTarg->trySetAttr<ATTR_PRD_HWP_PLID>(l_plid);
- } // non-zero PLID in attribute
-
-
- // Get the list of MEMORY related units (functional or not)
- getChildChiplets(l_memList, l_procTarg, l_memType, false);
-
- for ( auto l_memTarg : l_memList )
- {
- // check PROC target first for attribute
- l_memTarg->tryGetAttr<ATTR_PRD_HWP_PLID>(l_plid);
-
- if (0 != l_plid)
- {
- ATTN_SLOW("checkForIplAttentions MEM plid found");
-
- // If we had a prior ELOG, we need to commit it
- // since we will be creating another one here.
- if (NULL != l_plidElog)
- {
- errlCommit(l_plidElog, ATTN_COMP_ID);
- }
-
- // Build elog with same PLID value
- l_plidElog = new ErrlEntry( ERRL_SEV_UNRECOVERABLE,
- ATTN_CHK_IPL_ATTNS_MODULE,
- ATTN_SEE_HW_ERROR,
- l_plid, l_memType
- );
-
- // Make sure PLID matches the HW error
- l_plidElog->plid(l_plid);
-
- // clear attribute
- l_plid = 0;
- l_memTarg->trySetAttr<ATTR_PRD_HWP_PLID>(l_plid);
- } // non-zero PLID in attribute
-
- } // end for on mem target
+ // Clear the attribute.
+ (*trgt)->setAttr<ATTR_PRD_HWP_PLID>( 0 );
+ }
+ }
- } // end for loop on PROC targets
// ====================================================================
return l_plidElog;
diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C
index 9659476da..dc4493391 100644
--- a/src/usr/fapi2/plat_utils.C
+++ b/src/usr/fapi2/plat_utils.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -1038,99 +1038,37 @@ void logError(
/// @brief Internal Function associates PRD and HW elogs
/// Used by log_related_error
///
-void set_log_id( const Target<TARGET_TYPE_ALL>& i_target,
+void set_log_id( const Target<TARGET_TYPE_ALL>& i_fapiTrgt,
fapi2::ReturnCode& io_rc,
fapi2::errlSeverity_t i_sev )
{
- TARGETING::TYPE l_type;
- TARGETING::TargetHandleList l_targList;
- TARGETING::Target* l_attrTarget = NULL; // for setting attribute
-
-
- // Need model for nimbus/cumulus checks
- TARGETING::Target * l_masterProc;
- TARGETING::targetService().masterProcChipTargetHandle(l_masterProc);
- TARGETING::MODEL l_model = l_masterProc->getAttr<TARGETING::ATTR_MODEL>();
-
- // Create elog for FAPI error
- createPlatLog( io_rc, i_sev );
-
- // Get PLID for this elog
- errlHndl_t l_pError = reinterpret_cast<errlHndl_t>(io_rc.getPlatDataPtr());
- uint32_t plid = ERRL_GETPLID_SAFE(l_pError);
+ do
+ {
+ // Get TARGETING target.
+ TARGETING::Target* attrTrgt =
+ reinterpret_cast<TARGETING::Target*>(i_fapiTrgt.get());
+ if ( nullptr == attrTrgt )
+ {
+ FAPI_ERR( "[set_log_id] attrTrgt is null" );
+ break;
+ }
- // get target passed in
- TARGETING::Target* l_target =
- reinterpret_cast<TARGETING::Target*>(i_target.get());
+ // Create an error log for this FAPI error.
+ createPlatLog( io_rc, i_sev );
+ // Get the PLID from this error log.
+ errlHndl_t errl = reinterpret_cast<errlHndl_t>(io_rc.getPlatDataPtr());
+ uint32_t plid = ERRL_GETPLID_SAFE(errl);
- // PRD only uses this for PROC and MCA/DMI targets
- // so ensure we have one of those.
- if (NULL != l_target)
- {
- if ( l_target->tryGetAttr<TARGETING::ATTR_TYPE>(l_type) )
+ // Set the PLID in this attribute.
+ if ( ! attrTrgt->trySetAttr<TARGETING::ATTR_PRD_HWP_PLID>(plid) )
{
- switch (l_type)
- {
- case TARGETING::TYPE_PROC:
- case TARGETING::TYPE_MCA:
- case TARGETING::TYPE_DMI:
- // Supported for these targets
- l_attrTarget = l_target;
- break; // proc/mca/dmi
-
- case TARGETING::TYPE_DIMM:
- // Need parent MCA (or DMI)
- if ( TARGETING::MODEL_NIMBUS == l_model )
- { // NIMBUS
- getParentAffinityTargets( l_targList, l_target,
- TARGETING::CLASS_UNIT,
- TARGETING::TYPE_MCA );
-
- if (1 == l_targList.size())
- {
- l_attrTarget = l_targList[0];
- } // one parent found
-
- }
- else if ( TARGETING::MODEL_CUMULUS == l_model )
- { // CUMULUS
- getParentAffinityTargets( l_targList, l_target,
- TARGETING::CLASS_UNIT,
- TARGETING::TYPE_DMI );
-
- if (1 == l_targList.size())
- {
- l_attrTarget = l_targList[0];
- } // one parent found
- }
- else
- {
- // Unknown PROC type so don't do
- // anything till we add support
- FAPI_ERR("WARNING:set_log_id: UNKNOWN MODEL");
- Assert( TARGETING::MODEL_NIMBUS == l_model );
- } // end else new proc to work on
- break; // dimm
-
- default:
- // No idea what we have,
- // so don't use it or it
- // will explode on us.
- break;
-
- } // end switch on type
-
- } // if got target type
-
- if (NULL != l_attrTarget)
- {
- // Connect the PLID to PRD log
- l_attrTarget->trySetAttr<TARGETING::ATTR_PRD_HWP_PLID>( plid );
- } // attrTarget valid
-
- } // if valid target
+ FAPI_ERR( "[set_log_id] failed to set ATTR_PRD_HWP_PLID on 0x%08x",
+ TARGETING::get_huid(attrTrgt) );
+ break;
+ }
+ } while (0);
} // end set_log_id
diff --git a/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C b/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
index 6e4b7fff8..2a5ab6d40 100644
--- a/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
+++ b/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -137,47 +137,6 @@ uint32_t verifyHwpPrdAssociaton()
FAPI_INF("...verifyHwpPrdAssociation MCA done: PLID %08X", l_plid);
- // ==============================================================
- // HW procedures might pass DIMM so verify that works
- // ==============================================================
- TargetHandleList l_dimmList;
- getChildAffinityTargets( l_dimmList, l_mcaList[0],
- TARGETING::CLASS_NA,
- TARGETING::TYPE_DIMM );
-
- if (l_dimmList.size() >= 1)
- {
- FAPI_INF("...verifyHwpPrdAssociation DIMM:%d",
- l_dimmList.size() );
-
- // Using masterProc target as FAPI core target for test
- Target<fapi2::TARGET_TYPE_CORE> fapi2_dimmTarget(l_dimmList[0]);
- // We have to pass a FAPI RC so make one up
- l_fapiRc = verifyPrd_get_fapi2_error();
-
- // Init the attribute so we know if it changes
- l_mcaList[0]->setAttr<TARGETING::ATTR_PRD_HWP_PLID>( 0x33333333 );
-
- // Create/commit elog associated with PRD PLID attribute
- fapi2::log_related_error( fapi2_dimmTarget, l_fapiRc );
-
- // Verify that PLID attribute changed
- l_plid = l_mcaList[0]->getAttr<TARGETING::ATTR_PRD_HWP_PLID>();
-
- if (0x33333333 == l_plid)
- { // PLID did not change so routine failed somehow
- TS_FAIL(" verifyHwpPrdAssociation DIMM No PLID change:%08X",
- l_plid);
- l_rc = 1;
- }
- else
- { // PLID was altered, so that is good
- TS_TRACE(" verifyHwpPrdAssociation GOOD on DIMM");
- }
-
- FAPI_INF("...verifyHwpPrdAssociation DIMM done: PLID %08X", l_plid);
- } // end if any DIMMs
-
} // end if any MCAs
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 15800bfa3..c6284396c 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -122,6 +122,7 @@
<attribute>
<id>HDAT_EC</id>
</attribute>
+ <attribute><id>PRD_HWP_PLID</id></attribute>
</targetType>
<targetType>
@@ -315,6 +316,7 @@
<attribute>
<id>REL_POS</id>
</attribute>
+ <attribute><id>PRD_HWP_PLID</id></attribute>
</targetType>
<targetType>
@@ -1201,7 +1203,6 @@
<attribute><id>SBE_IS_STARTED</id></attribute>
<attribute><id>PROC_PCIE_PHB_ACTIVE</id></attribute>
<attribute><id>LPC_BUS_ADDR</id></attribute>
- <attribute><id>PRD_HWP_PLID</id></attribute>
</targetType>
<targetType>
@@ -1374,9 +1375,6 @@
<default>MEM</default>
<id>CDM_DOMAIN</id>
</attribute>
- <attribute>
- <id>PRD_HWP_PLID</id>
- </attribute>
<attribute><id>RCD_PARITY_RECONFIG_LOOP_COUNT</id></attribute>
</targetType>
OpenPOWER on IntegriCloud