Skip to content

Commit

Permalink
SW419349: Handle override of deconfig by Error vs FCO reasons by asso…
Browse files Browse the repository at this point in the history
…ciation

1. Override the deconfig reason of a parent ..
      a) getting deconfig by association due to error on its child &&
      b) has at least 1 other child already deconfig by FCO
      .. to deconfig by FCO
2. Override the deconfig reason of a child ..
      c) whose parent is getting deconfig by an error &&
      d) that is itself already deconfig by FCO
      .. to deconfig by that error

Change-Id: I9c73fe35aedb832f9a4b33bd299bb30fe589095c
CQ: SW419349
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59934
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
am10dolkar authored and dcrowell77 committed Jun 18, 2018
1 parent 36d47d4 commit 8fcc681
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 28 deletions.
15 changes: 15 additions & 0 deletions src/include/usr/hwas/common/deconfigGard.H
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,21 @@ private:
bool anyChildFunctional(
TARGETING::Target & i_parent);

/**
* @brief Return FCO state of children
*
* Called by _deconfigureByAssoc().
* This function gets list of all children. If state of any
* child is deconfig by FCO, then returns true.
*
* @param[in] Pointer parent target id
*
* @return true if any child state is deconfig by FCO.
*
*/
bool anyChildFCO(
TARGETING::Target & i_parent);

public:

/**
Expand Down
25 changes: 24 additions & 1 deletion src/include/usr/targeting/common/predicates/predicatehwas.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -136,6 +136,17 @@ class PredicateHwas : public PredicateBase
* @return Reference to the predicate, for chaining
*/
PredicateHwas& specdeconfig(const bool i_specdeconfig);

/**
* @brief Configure predicate to look for the given deconfig by
* error log id or enum value
*
* @param[in] i_eid Desired value of deconfig by EID
*
* @return Reference to the predicate, for chaining
*/
PredicateHwas& deconfiguredByEid(const uint32_t i_eid);

/**
* @brief Returns whether target matches the desired HWAS state
*
Expand Down Expand Up @@ -250,6 +261,18 @@ inline PredicateHwas& PredicateHwas::specdeconfig(
iv_valid.attribute.specdeconfig = true;
return *this;
}

//******************************************************************************
// PredicateHwas::deconfiguredByEid
//******************************************************************************
inline PredicateHwas& PredicateHwas::deconfiguredByEid(
const uint32_t i_eid)
{
iv_desired.attribute.deconfiguredByEid = i_eid;
iv_valid.attribute.deconfiguredByEid = 0xFFFFFFFF;
return *this;
}

#undef TARG_CLASS
#undef TARG_NAMESPACE

Expand Down
114 changes: 87 additions & 27 deletions src/usr/hwas/common/deconfigGard.C
Original file line number Diff line number Diff line change
Expand Up @@ -1523,12 +1523,21 @@ void DeconfigGard::_deconfigureByAssoc(
isFunctional.specdeconfig(false);
}

// If there are child targets deconfig by FCO, override the reason
// with that of the parent's deconfg EID
PredicateHwas isFCO;
isFCO.present(true).functional(false)
.deconfiguredByEid(DECONFIGURED_BY_FIELD_CORE_OVERRIDE);

PredicatePostfixExpr funcOrFco;
funcOrFco.push(&isFunctional).push(&isFCO).Or();

// note - ATTR_DECONFIG_GARDABLE is NOT checked for all 'by association'
// deconfigures, as that attribute is only for direct deconfigure requests.

// find all CHILD targets and deconfigure them
targetService().getAssociated(pChildList, &i_target,
TargetService::CHILD, TargetService::ALL, &isFunctional);
TargetService::CHILD, TargetService::ALL, &funcOrFco);
for (TargetHandleList::iterator pChild_it = pChildList.begin();
pChild_it != pChildList.end();
++pChild_it)
Expand All @@ -1555,7 +1564,7 @@ void DeconfigGard::_deconfigureByAssoc(
// find all CHILD_BY_AFFINITY targets and deconfigure them
targetService().getAssociated(pChildList, &i_target,
TargetService::CHILD_BY_AFFINITY, TargetService::ALL,
&isFunctional);
&funcOrFco);
for (TargetHandleList::iterator pChild_it = pChildList.begin();
pChild_it != pChildList.end();
++pChild_it)
Expand Down Expand Up @@ -1613,11 +1622,23 @@ void DeconfigGard::_deconfigureByAssoc(
// if both cores of EX non-functional, de-config EX
else if (!anyChildFunctional(*l_parentEX))
{
uint32_t l_errlEidOverride = i_errlEid;

// If any sibling is not functional due to FCO, override
// the deconfig by Eid reason of its parent to FCO
if (anyChildFCO(*l_parentEX))
{
HWAS_INF("Override EX %.8X deconfigByEid %.8X->FCO",
get_huid(l_parentEX), i_errlEid);
l_errlEidOverride =
DECONFIGURED_BY_FIELD_CORE_OVERRIDE;
}

// If parent is functional, deconfigure it
_deconfigureTarget(*l_parentEX,
i_errlEid, NULL, i_deconfigRule);
l_errlEidOverride, NULL, i_deconfigRule);
_deconfigureByAssoc(*l_parentEX,
i_errlEid,i_deconfigRule);
l_errlEidOverride, i_deconfigRule);
} // is_fused
} // isFunctional
break;
Expand All @@ -1641,7 +1662,19 @@ void DeconfigGard::_deconfigureByAssoc(

if (!anyChildFunctional(*l_targetEq))
{
_deconfigureTarget(*l_targetEq, i_errlEid, NULL,
uint32_t l_errlEidOverride = i_errlEid;

// If any sibling is not functional due to FCO, override
// the deconfig by Eid reason of its parent to FCO
if (anyChildFCO(*l_targetEq))
{
HWAS_INF("Override EQ %.8X deconfigByEid %.8X->FCO",
get_huid(l_targetEq), i_errlEid);
l_errlEidOverride =
DECONFIGURED_BY_FIELD_CORE_OVERRIDE;
}

_deconfigureTarget(*l_targetEq, l_errlEidOverride, NULL,
i_deconfigRule);
}

Expand Down Expand Up @@ -2088,6 +2121,16 @@ void DeconfigGard::_deconfigureTarget(
// state changed, so do the setAttr
i_target.setAttr<ATTR_HWAS_STATE>(l_state);
}

if (l_state.deconfiguredByEid == DECONFIGURED_BY_FIELD_CORE_OVERRIDE)
{
// A child target was deconfig by FCO, and parent is being deconfig
// with a non-FCO reason .. override with parent's EID
HWAS_INF("HUID %.8X, Overriding deconfigByEid from FCO->%.8X",
get_huid(&i_target), i_errlEid);
l_state.deconfiguredByEid = i_errlEid;
i_target.setAttr<ATTR_HWAS_STATE>(l_state);
}
}
else
{
Expand Down Expand Up @@ -2875,33 +2918,50 @@ void DeconfigGard::_clearFCODeconfigure(ConstTargetHandle_t i_nodeTarget)
bool DeconfigGard::anyChildFunctional(Target & i_parent)
{
bool retVal = false;
do
TargetHandleList pChildList;
PredicateHwas isFunctional;
isFunctional.functional(true);

if (isFunctional(&i_parent))
{
TargetHandleList pChildList;
PredicateHwas isFunctional;
isFunctional.functional(true);
if (isFunctional(&i_parent))
{
// find all CHILD targets
// if any of them are functional return true
// if all of them are non-functional return false
targetService().getAssociated(pChildList, &i_parent,
TargetService::CHILD, TargetService::ALL, &isFunctional);
for (TargetHandleList::iterator pChild_it = pChildList.begin();
pChild_it != pChildList.end();
++pChild_it)
{
if (isFunctional(*pChild_it))
{
retVal = true;
break;
}
}
// find all CHILD targets, that match the predicate
// if any of them are functional return true
// if all of them are non-functional return false
targetService().getAssociated(pChildList, &i_parent,
TargetService::CHILD, TargetService::ALL, &isFunctional);

if (pChildList.size() >= 1)
{
retVal = true;
}
}while(0);
}
return retVal;
} //anyChildFunctional

bool DeconfigGard::anyChildFCO (Target & i_parent)
{
bool retVal = false;

TargetHandleList pChildList;
PredicateHwas predFCO;
predFCO.present(true)
.functional(false)
.deconfiguredByEid(DECONFIGURED_BY_FIELD_CORE_OVERRIDE);

// find all CHILD targets, that match the predicate
// if any of them are FCO return true
// if none of them are FCO return false
targetService().getAssociated(pChildList, &i_parent,
TargetService::CHILD, TargetService::ALL, &predFCO);

if (pChildList.size() >= 1)
{
retVal = true;
}

return retVal;
} //anyChildFCO

#ifdef __HOSTBOOT_MODULE
/******************************************************************************/
// deconfigureTargetAtRuntime
Expand Down

0 comments on commit 8fcc681

Please sign in to comment.