summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-01-16 15:19:35 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-04 13:50:22 -0600
commit863c93d1fbd3da8ad18f161e9913567432abc7a9 (patch)
tree501092fdbff718bb01d0b0dd19c560325ab2c44f /src
parent11d14529a299e97b526afcd1ff83ef4de7cedaf8 (diff)
downloadblackbird-hostboot-863c93d1fbd3da8ad18f161e9913567432abc7a9.tar.gz
blackbird-hostboot-863c93d1fbd3da8ad18f161e9913567432abc7a9.zip
only processes GARD records for certain targets
MPIPL needs capability to do initial collectGard() function on a subset of targets (ie, EX only ). Add new optional TARGETING::Predicate parameter and only call deconfigure for GARD records that match. Change-Id: Ib16d8d9431a797df0dbe625adeb5cffc7c073a7d RTC: 59089 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2947 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwas/common/deconfigGard.H11
-rw-r--r--src/usr/hwas/common/deconfigGard.C33
2 files changed, 31 insertions, 13 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H
index 01493ecb9..f1507980f 100644
--- a/src/include/usr/hwas/common/deconfigGard.H
+++ b/src/include/usr/hwas/common/deconfigGard.H
@@ -45,12 +45,13 @@ namespace HWAS
*
* It will call into hwas platform-specific functions.
*
- * @param none
+ * @param i_pPredicate restrict processing - only look at GARD records
+ * for targets that match the predicate (optional)
*
* @return errlHndl_t valid errlHndl_t handle if there was an error
* NULL if no errors;
*/
-errlHndl_t collectGard();
+errlHndl_t collectGard(const TARGETING::PredicateBase *i_pPredicate = NULL);
/**
* @brief Returns a reference to the DeconfigGard singleton.
@@ -153,6 +154,9 @@ public:
/**
* @brief Deconfigures Targets that have GARD Records in preparation to IPL.
*
+ * @param i_pPredicate restrict processing - only look at GARD records
+ * for targets that match the predicate (optional)
+ *
* Called by HWAS as part of initial IPL steps.
*
* If deconfiguring all such Targets will result in a configuration that is
@@ -161,7 +165,8 @@ public:
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t deconfigureTargetsFromGardRecordsForIpl();
+ errlHndl_t deconfigureTargetsFromGardRecordsForIpl(
+ const TARGETING::PredicateBase *i_pPredicate = NULL);
/**
* @brief Deconfigures a Target.
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index c6a7f79ac..07f35c4c4 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -53,7 +53,7 @@ namespace HWAS
using namespace HWAS::COMMON;
-errlHndl_t collectGard()
+errlHndl_t collectGard(const TARGETING::PredicateBase *i_pPredicate)
{
HWAS_INF("collectGard entry" );
@@ -66,7 +66,8 @@ errlHndl_t collectGard()
}
else
{
- errl = theDeconfigGard().deconfigureTargetsFromGardRecordsForIpl();
+ errl = theDeconfigGard().
+ deconfigureTargetsFromGardRecordsForIpl(i_pPredicate);
if (errl)
{
@@ -118,7 +119,8 @@ errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
}
//******************************************************************************
-errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl()
+errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
+ const TARGETING::PredicateBase *i_pPredicate)
{
HWAS_INF("Usr Request: Deconfigure Targets from GARD Records for IPL");
HWAS_MUTEX_LOCK(iv_mutex);
@@ -168,6 +170,17 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl()
}
else
{
+ if (i_pPredicate)
+ {
+ // if this does NOT match, continue to next in loop
+ if ((*i_pPredicate)(l_pTarget) == false)
+ {
+ HWAS_INF("skipping %.8X - predicate didn't match",
+ TARGETING::get_huid(l_pTarget));
+ continue;
+ }
+ }
+
// Deconfigure the Target
_deconfigureTarget(*l_pTarget, (*l_itr).iv_errlogPlid,
DECONFIG_CAUSE_GARD_RECORD);
@@ -274,7 +287,7 @@ void DeconfigGard::_deconfigureByAssoc(TARGETING::Target & i_target,
const uint32_t i_errlPlid)
{
HWAS_INF("****TBD****: Deconfiguring by Association for: %.8X",
- i_target.getAttr<TARGETING::ATTR_HUID>());
+ TARGETING::get_huid(&i_target));
// TODO
}
@@ -285,13 +298,13 @@ void DeconfigGard::_deconfigureTarget(TARGETING::Target & i_target,
const DeconfigCause i_cause)
{
HWAS_INF("Deconfiguring Target %.8X",
- i_target.getAttr<TARGETING::ATTR_HUID>());
+ TARGETING::get_huid(&i_target));
if (!i_target.getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>())
{
// Target is not Deconfigurable. Commit an error
HWAS_ERR("Target %.8X not Deconfigurable",
- i_target.getAttr<TARGETING::ATTR_HUID>());
+ TARGETING::get_huid(&i_target));
/*@
* @errortype
@@ -302,7 +315,7 @@ void DeconfigGard::_deconfigureTarget(TARGETING::Target & i_target,
* @userdata1 HUID of input target
*/
const uint64_t userdata1 = static_cast<uint64_t>
- (i_target.getAttr<TARGETING::ATTR_HUID>()) << 32;
+ (TARGETING::get_huid(&i_target)) << 32;
errlHndl_t l_pErr = hwasError(
ERRL_SEV_INFORMATIONAL,
HWAS::MOD_DECONFIG_GARD,
@@ -472,7 +485,7 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target,
TARGETING::EntityPath l_id = i_target.getAttr<TARGETING::ATTR_PHYS_PATH>();
HWAS_INF("Creating GARD Record for %.8X",
- i_target.getAttr<TARGETING::ATTR_HUID>());
+ TARGETING::get_huid(&i_target));
do
{
@@ -491,7 +504,7 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target,
* @userdata1 HUID of input target
*/
const uint64_t userdata1 =
- (uint64_t)i_target.getAttr<TARGETING::ATTR_HUID>() << 32;
+ (uint64_t)(TARGETING::get_huid(&i_target)) << 32;
l_pErr = hwasError(
ERRL_SEV_UNRECOVERABLE,
HWAS::MOD_DECONFIG_GARD,
@@ -535,7 +548,7 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target,
* @userdata1 HUID of input target
*/
const uint64_t userdata1 =
- (uint64_t)i_target.getAttr<TARGETING::ATTR_HUID>() << 32;
+ (uint64_t)(TARGETING::get_huid(&i_target)) << 32;
l_pErr = hwasError(
ERRL_SEV_UNRECOVERABLE,
HWAS::MOD_DECONFIG_GARD,
OpenPOWER on IntegriCloud