diff options
| author | Brian Horton <brianh@linux.ibm.com> | 2013-10-04 16:32:45 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-28 11:37:47 -0500 |
| commit | 495ca1eff5f91ab577dc6b923bd766a6dfaa59ba (patch) | |
| tree | 12c31c47edf45d66a2a9409655f3bb1de484dfd7 /src | |
| parent | 9cd34b6ba83aad88ba54aad529f1a46aa8f20189 (diff) | |
| download | blackbird-hostboot-495ca1eff5f91ab577dc6b923bd766a6dfaa59ba.tar.gz blackbird-hostboot-495ca1eff5f91ab577dc6b923bd766a6dfaa59ba.zip | |
update deconfigureByAssociation behavior for runtime
If deconfigureTarget() is called from PRD at runtime, we
don't want all of the 'deconfigureByAssocation' actions taken.
Specifically, we want to mark the target and it's CHILDren
as non-functional and nothing else. (ie, for MEMBUF, do not
follow the rules that might mark interleaved targets as
non-functional.)
Change-Id: I484bd45d5f6cf6ff4f8a3f696836675dda3b5d1e
RTC: 86960
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6584
Tested-by: Jenkins Server
Reviewed-by: SHELDON R. BAILEY <baileysh@us.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@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.H | 11 | ||||
| -rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 484 |
2 files changed, 262 insertions, 233 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H index c1288978e..c76ee740f 100644 --- a/src/include/usr/hwas/common/deconfigGard.H +++ b/src/include/usr/hwas/common/deconfigGard.H @@ -239,7 +239,7 @@ public: * * @return uint32_t 'counter' of deconfigure events */ - uint32_t getDeconfigureStatus(); + uint32_t getDeconfigureStatus() const; /** * @brief Registers a Deferred Deconfigure @@ -248,9 +248,8 @@ public: * by hwasCallout when the user requests a * Deferred Deconfigure request. * - * For now, just put a mark on the wall indicating that we got a deferred - * deconfigure callout - * TODO RTC: 45781 + * Create a deconfigure record, which will be handled in the function + * processDeferredDeconfig(). * * @param[in] i_target Reference to Target to deconfigure. * @param[in] i_errlEid Error log EID to store in Deconfigure Record. @@ -405,9 +404,11 @@ private: * * @param[in] i_target Reference to base Target. * @param[in] i_errlEid Error log EID to store in Deconfigure Record. + * @param[in] i_atRunTime if true, at runtime - bypass some associations */ void _deconfigureByAssoc(TARGETING::Target & i_target, - const uint32_t i_errlEid); + const uint32_t i_errlEid, + bool i_atRunTime = false); /** * @brief Deconfigures a Target. diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index a23c49398..87ee897c8 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -580,10 +580,28 @@ errlHndl_t DeconfigGard::deconfigureTarget(Target & i_target, // the is System is at runtime if (!i_evenAtRunTime && platSystemIsAtRuntime()) { - HWAS_INF("Skipping deconfigTarget - System at Runtime"); + HWAS_ERR("Skipping deconfigureTarget: System at Runtime; target %.8X", + get_huid(&i_target)); break; } + // just to make sure that we haven't missed anything in development + // AT RUNTIME: we should only be called to deconfigure types: + // NX, EX, MEMBUF. + if (i_evenAtRunTime) + { + TYPE target_type = i_target.getAttr<ATTR_TYPE>(); + // TODO RTC 88471: use attribute vs hardcoded list. + if (!((target_type == TYPE_MEMBUF) || + (target_type == TYPE_NX) || + (target_type == TYPE_EX))) + { + HWAS_ERR("Skipping deconfigureTarget: eventAtRunTime with unexpected target %.8X type %d -- SKIPPING", + get_huid(&i_target), target_type); + break; + } + } + const ATTR_DECONFIG_GARDABLE_type lDeconfigGardable = i_target.getAttr<ATTR_DECONFIG_GARDABLE>(); const uint8_t lPresent = @@ -624,7 +642,7 @@ errlHndl_t DeconfigGard::deconfigureTarget(Target & i_target, _deconfigureTarget(i_target, i_errlEid); // Deconfigure other Targets by association - _deconfigureByAssoc(i_target, i_errlEid); + _deconfigureByAssoc(i_target, i_errlEid, i_evenAtRunTime); HWAS_MUTEX_UNLOCK(iv_mutex); @@ -1026,9 +1044,11 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() //****************************************************************************** void DeconfigGard::_deconfigureByAssoc(Target & i_target, - const uint32_t i_errlEid) + const uint32_t i_errlEid, + bool i_atRunTime) { - HWAS_INF("deconfigByAssoc for %.8X", get_huid(&i_target)); + HWAS_INF("deconfigByAssoc for %.8X (atRunTime %d)", + get_huid(&i_target), i_atRunTime); // some common variables used below TargetHandleList pChildList; @@ -1067,268 +1087,276 @@ void DeconfigGard::_deconfigureByAssoc(Target & i_target, _deconfigureByAssoc(*pChild, i_errlEid); } // for CHILD_BY_AFFINITY - // Handles bus endpoint (TYPE_XBUS, TYPE_ABUS) and - // memory (TYPE_MEMBUF, TYPE_MBA, TYPE_DIMM) - // deconfigureByAssociation rules - switch (i_target.getAttr<ATTR_TYPE>()) + if (!i_atRunTime) { - case TYPE_MEMBUF: + // only do these 'by association' checks if we are NOT at runtime + // reason is, we're not really deconfigureing anything, we're just + // marking them as non-functional. we only want to do that for the + // desired target and it's CHILD + + // Handles bus endpoint (TYPE_XBUS, TYPE_ABUS) and + // memory (TYPE_MEMBUF, TYPE_MBA, TYPE_DIMM) + // deconfigureByAssociation rules + switch (i_target.getAttr<ATTR_TYPE>()) { - // get parent MCS - TargetHandleList pParentMcsList; - getParentAffinityTargets(pParentMcsList, &i_target, - CLASS_UNIT, TYPE_MCS, true /*functional*/); - HWAS_ASSERT((pParentMcsList.size() <= 1), - "HWAS deconfigByAssoc: pParentMcsList > 1"); - - // done if parent is already deconfigured - if (pParentMcsList.empty()) + case TYPE_MEMBUF: { - break; - } + // get parent MCS + TargetHandleList pParentMcsList; + getParentAffinityTargets(pParentMcsList, &i_target, + CLASS_UNIT, TYPE_MCS, true /*functional*/); + HWAS_ASSERT((pParentMcsList.size() <= 1), + "HWAS _deconfigureByAssoc: pParentMcsList > 1"); + + // done if parent is already deconfigured + if (pParentMcsList.empty()) + { + break; + } - // deconfigure the parent - const Target *l_parentMcs = pParentMcsList[0]; - HWAS_INF("deconfigByAssoc MEMBUF parent MCS: %.8X", - get_huid(l_parentMcs)); - _deconfigureTarget(const_cast<Target &> (*l_parentMcs), - i_errlEid); - _deconfigureByAssoc(const_cast<Target &> (*l_parentMcs), - i_errlEid); - - Target *pSys; - targetService().getTopLevelTarget(pSys); - HWAS_ASSERT(pSys, "HWAS _deconfigureByAssoc: no TopLevelTarget"); - - // done if not in interleaved mode - if (!pSys->getAttr<ATTR_ALL_MCS_IN_INTERLEAVING_GROUP>()) - { - break; - } + // deconfigure the parent + const Target *l_parentMcs = pParentMcsList[0]; + HWAS_INF("deconfigByAssoc MEMBUF parent MCS: %.8X", + get_huid(l_parentMcs)); + _deconfigureTarget(const_cast<Target &> (*l_parentMcs), + i_errlEid); + _deconfigureByAssoc(const_cast<Target &> (*l_parentMcs), + i_errlEid); - // if paired mode (interleaved) - // deconfigure paired MCS and MEMBUF (Centaur) - // find paired MCS / MEMBUF (Centaur) - TargetHandleList pMcsList; - findMcsInGroup(l_parentMcs, pMcsList); + Target *pSys; + targetService().getTopLevelTarget(pSys); + HWAS_ASSERT(pSys, "HWAS _deconfigureByAssoc: no TopLevelTarget"); - // deconfigure each paired MCS - for (TargetHandleList::iterator pMcs_it = pMcsList.begin(); - pMcs_it != pMcsList.end(); - ++pMcs_it) - { - TargetHandle_t pMcs = *pMcs_it; + // done if not in interleaved mode + if (!pSys->getAttr<ATTR_ALL_MCS_IN_INTERLEAVING_GROUP>()) + { + break; + } - HWAS_INF("deconfigByAssoc MCS (& MEMBUF) paired: %.8X", - get_huid(pMcs)); - _deconfigureTarget(*pMcs, i_errlEid); - _deconfigureByAssoc(*pMcs, i_errlEid); - } // for - break; - } // TYPE_MEMBUF + // if paired mode (interleaved) + // deconfigure paired MCS and MEMBUF (Centaur) + // find paired MCS / MEMBUF (Centaur) + TargetHandleList pMcsList; + findMcsInGroup(l_parentMcs, pMcsList); - case TYPE_MBA: - { - // get parent MEMBUF (Centaur) - const Target *l_parentMembuf = getParentChip(&i_target); - - // get children DIMM that are functional - PredicateCTM predDimm(CLASS_LOGICAL_CARD, TYPE_DIMM); - PredicatePostfixExpr checkExpr; - checkExpr.push(&predDimm).push(&isFunctional).And(); - TargetHandleList pDimmList; - targetService().getAssociated(pDimmList, l_parentMembuf, - TargetService::CHILD_BY_AFFINITY, TargetService::ALL, - &checkExpr); - - // if parent MEMBUF (Centaur) has no functional memory - if (pDimmList.empty()) - { - // deconfigure parent MEMBUF (Centaur) - HWAS_INF("deconfigByAssoc MEMBUF parent with no memory: %.8X", - get_huid(l_parentMembuf)); - _deconfigureTarget(const_cast<Target &> (*l_parentMembuf), - i_errlEid); - _deconfigureByAssoc(const_cast<Target &> (*l_parentMembuf), - i_errlEid); + // deconfigure each paired MCS + for (TargetHandleList::iterator pMcs_it = pMcsList.begin(); + pMcs_it != pMcsList.end(); + ++pMcs_it) + { + TargetHandle_t pMcs = *pMcs_it; - // and we're done, so break; + HWAS_INF("deconfigByAssoc MCS (& MEMBUF) paired: %.8X", + get_huid(pMcs)); + _deconfigureTarget(*pMcs, i_errlEid); + _deconfigureByAssoc(*pMcs, i_errlEid); + } // for break; - } - - // parent MEMBUF still has functional memory - Target *pSys; - targetService().getTopLevelTarget(pSys); - HWAS_ASSERT(pSys, "HWAS _deconfigureByAssoc: no TopLevelTarget"); + } // TYPE_MEMBUF - // done if not in interleaved mode - if (!pSys->getAttr<ATTR_ALL_MCS_IN_INTERLEAVING_GROUP>()) + case TYPE_MBA: { - break; - } + // get parent MEMBUF (Centaur) + const Target *l_parentMembuf = getParentChip(&i_target); - // we need to make sure that MBA memory is balanced. + // get children DIMM that are functional + PredicateCTM predDimm(CLASS_LOGICAL_CARD, TYPE_DIMM); + PredicatePostfixExpr checkExpr; + checkExpr.push(&predDimm).push(&isFunctional).And(); + TargetHandleList pDimmList; + targetService().getAssociated(pDimmList, l_parentMembuf, + TargetService::CHILD_BY_AFFINITY, TargetService::ALL, + &checkExpr); - // find parent MCS - TargetHandleList pParentMcsList; - getParentAffinityTargets(pParentMcsList, l_parentMembuf, - CLASS_UNIT, TYPE_MCS, true /*functional*/); - HWAS_ASSERT((pParentMcsList.size() <= 1), - "HWAS deconfigByAssoc: pParentMcsList > 1"); + // if parent MEMBUF (Centaur) has no functional memory + if (pDimmList.empty()) + { + // deconfigure parent MEMBUF (Centaur) + HWAS_INF("deconfigByAssoc MEMBUF parent with no memory: %.8X", + get_huid(l_parentMembuf)); + _deconfigureTarget(const_cast<Target &> (*l_parentMembuf), + i_errlEid); + _deconfigureByAssoc(const_cast<Target &> (*l_parentMembuf), + i_errlEid); + + // and we're done, so break; + break; + } - if (pParentMcsList.empty()) - { - // MCS is already deconfigured, we're done - break; - } + // parent MEMBUF still has functional memory + Target *pSys; + targetService().getTopLevelTarget(pSys); + HWAS_ASSERT(pSys, "HWAS _deconfigureByAssoc: no TopLevelTarget"); + + // done if not in interleaved mode + if (!pSys->getAttr<ATTR_ALL_MCS_IN_INTERLEAVING_GROUP>()) + { + break; + } - // MEMBUF only has 1 parent - const Target *l_parentMcs = pParentMcsList[0]; + // we need to make sure that MBA memory is balanced. - // find paired MCS / MEMBUF (Centaur) - TargetHandleList pMcsList; - findMcsInGroup(l_parentMcs, pMcsList); + // find parent MCS + TargetHandleList pParentMcsList; + getParentAffinityTargets(pParentMcsList, l_parentMembuf, + CLASS_UNIT, TYPE_MCS, true /*functional*/); + HWAS_ASSERT((pParentMcsList.size() <= 1), + "HWAS _deconfigureByAssoc: pParentMcsList > 1"); - // how much memory does this MBA have - ATTR_EFF_DIMM_SIZE_type l_dimmSize; - i_target.tryGetAttr<ATTR_EFF_DIMM_SIZE>(l_dimmSize); - const uint64_t l_mbaDimmSize = - l_dimmSize[0][0] + l_dimmSize[0][1] + - l_dimmSize[1][0] + l_dimmSize[1][1]; + if (pParentMcsList.empty()) + { + // MCS is already deconfigured, we're done + break; + } - if (l_mbaDimmSize == 0) - { // before this attribute has been set, so don't check - break; - } + // MEMBUF only has 1 parent + const Target *l_parentMcs = pParentMcsList[0]; - // now we'll walk thru MCS targets in the group, find MBAs - // that match in memory size, and deconfigure them, and add - // them to this list to do the deconfigByAssoc afterward. - TargetHandleList l_deconfigList; + // find paired MCS / MEMBUF (Centaur) + TargetHandleList pMcsList; + findMcsInGroup(l_parentMcs, pMcsList); - // for each paired MCS in the group - for (TargetHandleList::iterator pMcs_it = pMcsList.begin(); - pMcs_it != pMcsList.end(); - ++pMcs_it) - { - TargetHandle_t pMcs = *pMcs_it; + // how much memory does this MBA have + ATTR_EFF_DIMM_SIZE_type l_dimmSize; + i_target.tryGetAttr<ATTR_EFF_DIMM_SIZE>(l_dimmSize); + const uint64_t l_mbaDimmSize = + l_dimmSize[0][0] + l_dimmSize[0][1] + + l_dimmSize[1][0] + l_dimmSize[1][1]; - if (pMcs == l_parentMcs) - { // this is 'my' MCS - continue - continue; + if (l_mbaDimmSize == 0) + { // before this attribute has been set, so don't check + break; } - // search for memory on EITHER of its MBA that matchs - TargetHandleList pMbaList; - PredicateCTM predMba(CLASS_UNIT, TYPE_MBA); - PredicatePostfixExpr checkExpr; - checkExpr.push(&predMba).push(&isFunctional).And(); - targetService().getAssociated(pMbaList, pMcs, - TargetService::CHILD_BY_AFFINITY, TargetService::ALL, - &checkExpr); - - // if there are 2 functional MBA, then one of them matches - // the MBA we just deconfigured, so we need to find the - // match and deconfigure it. + // now we'll walk thru MCS targets in the group, find MBAs + // that match in memory size, and deconfigure them, and add + // them to this list to do the deconfigByAssoc afterward. + TargetHandleList l_deconfigList; - // assumes 2 MBA per MEMBUF. if this changes, then instead - // of '1', count the number of MBAs under this MEMBUF and - // use that as the comparison. - if (pMbaList.size() != 1) // this != myMbaCount + // for each paired MCS in the group + for (TargetHandleList::iterator pMcs_it = pMcsList.begin(); + pMcs_it != pMcsList.end(); + ++pMcs_it) { - // unbalanced, so lets find one to deconfigure - for (TargetHandleList::iterator - pMba_it = pMbaList.begin(); - pMba_it != pMbaList.end(); - ++pMba_it) + TargetHandle_t pMcs = *pMcs_it; + + if (pMcs == l_parentMcs) + { // this is 'my' MCS - continue + continue; + } + + // search for memory on EITHER of its MBA that matchs + TargetHandleList pMbaList; + PredicateCTM predMba(CLASS_UNIT, TYPE_MBA); + PredicatePostfixExpr checkExpr; + checkExpr.push(&predMba).push(&isFunctional).And(); + targetService().getAssociated(pMbaList, pMcs, + TargetService::CHILD_BY_AFFINITY, TargetService::ALL, + &checkExpr); + + // if there are 2 functional MBA, then one of them matches + // the MBA we just deconfigured, so we need to find the + // match and deconfigure it. + + // assumes 2 MBA per MEMBUF. if this changes, then instead + // of '1', count the number of MBAs under this MEMBUF and + // use that as the comparison. + if (pMbaList.size() != 1) // this != myMbaCount { - TargetHandle_t pMba = *pMba_it; - pMba->tryGetAttr<ATTR_EFF_DIMM_SIZE>(l_dimmSize); - const uint64_t l_thisDimmSize = - l_dimmSize[0][0] + l_dimmSize[0][1] + - l_dimmSize[1][0] + l_dimmSize[1][1]; - - // if this MBA matches, deconfigure it. - if (l_mbaDimmSize == l_thisDimmSize) + // unbalanced, so lets find one to deconfigure + for (TargetHandleList::iterator + pMba_it = pMbaList.begin(); + pMba_it != pMbaList.end(); + ++pMba_it) { - HWAS_INF("deconfigByAssoc MBA matched: %.8X", - get_huid(pMba)); - _deconfigureTarget(*pMba, i_errlEid); - l_deconfigList.push_back(pMba); - break; // only need to do 1 MBA - we're done. - } - } // for MBA - } // if 2 functional MBA - } // for paired MCS - - // now loop thru and do the ByAssoc deconfig for each of the - // MBA targets. this should get the CHILD associations, but - // won't cause any pair deconfigs, since we coverered that - // already. - for (TargetHandleList::iterator - pMba_it = l_deconfigList.begin(); - pMba_it != l_deconfigList.end(); - ++pMba_it) - { - TargetHandle_t pMba = *pMba_it; - HWAS_INF("deconfigByAssoc MBA matched (bA): %.8X", - get_huid(pMba)); - _deconfigureByAssoc(*pMba, i_errlEid); - } // for - break; - } // TYPE_MBA + TargetHandle_t pMba = *pMba_it; + pMba->tryGetAttr<ATTR_EFF_DIMM_SIZE>(l_dimmSize); + const uint64_t l_thisDimmSize = + l_dimmSize[0][0] + l_dimmSize[0][1] + + l_dimmSize[1][0] + l_dimmSize[1][1]; + + // if this MBA matches, deconfigure it. + if (l_mbaDimmSize == l_thisDimmSize) + { + HWAS_INF("deconfigByAssoc MBA matched: %.8X", + get_huid(pMba)); + _deconfigureTarget(*pMba, i_errlEid); + l_deconfigList.push_back(pMba); + break; // only need to do 1 MBA - we're done. + } + } // for MBA + } // if 2 functional MBA + } // for paired MCS + + // now loop thru and do the ByAssoc deconfig for each of the + // MBA targets. this should get the CHILD associations, but + // won't cause any pair deconfigs, since we coverered that + // already. + for (TargetHandleList::iterator + pMba_it = l_deconfigList.begin(); + pMba_it != l_deconfigList.end(); + ++pMba_it) + { + TargetHandle_t pMba = *pMba_it; + HWAS_INF("deconfigByAssoc MBA matched (bA): %.8X", + get_huid(pMba)); + _deconfigureByAssoc(*pMba, i_errlEid); + } // for + break; + } // TYPE_MBA - case TYPE_DIMM: - { - // get deconfigure parent MBA - TargetHandleList pParentMbaList; - getParentAffinityTargets(pParentMbaList, &i_target, - CLASS_UNIT, TYPE_MBA, true /*functional*/); - HWAS_ASSERT((pParentMbaList.size() <= 1), - "HWAS deconfigByAssoc: pParentMbaList > 1"); - - // if parent MBA hasn't already been deconfigured - if (!pParentMbaList.empty()) + case TYPE_DIMM: { - const Target *l_parentMba = pParentMbaList[0]; - HWAS_INF("deconfigByAssoc DIMM parent MBA: %.8X", - get_huid(l_parentMba)); - _deconfigureTarget(const_cast<Target &> (*l_parentMba), - i_errlEid); - _deconfigureByAssoc(const_cast<Target &> (*l_parentMba), - i_errlEid); - } - break; - } // TYPE_DIMM + // get deconfigure parent MBA + TargetHandleList pParentMbaList; + getParentAffinityTargets(pParentMbaList, &i_target, + CLASS_UNIT, TYPE_MBA, true /*functional*/); + HWAS_ASSERT((pParentMbaList.size() <= 1), + "HWAS _deconfigureByAssoc: pParentMbaList > 1"); + + // if parent MBA hasn't already been deconfigured + if (!pParentMbaList.empty()) + { + const Target *l_parentMba = pParentMbaList[0]; + HWAS_INF("deconfigByAssoc DIMM parent MBA: %.8X", + get_huid(l_parentMba)); + _deconfigureTarget(const_cast<Target &> (*l_parentMba), + i_errlEid); + _deconfigureByAssoc(const_cast<Target &> (*l_parentMba), + i_errlEid); + } + break; + } // TYPE_DIMM - // If target is a bus endpoint, deconfigure its peer - case TYPE_XBUS: - case TYPE_ABUS: - { - // Get peer endpoint target - const Target * l_pDstTarget = i_target. - getAttr<ATTR_PEER_TARGET>(); - // If target is valid - if (l_pDstTarget) + // If target is a bus endpoint, deconfigure its peer + case TYPE_XBUS: + case TYPE_ABUS: { - // Deconfigure peer endpoint - HWAS_INF("deconfigByAssoc BUS Peer: %.8X", - get_huid(l_pDstTarget)); - _deconfigureTarget(const_cast<Target &> (*l_pDstTarget), - i_errlEid); - } + // Get peer endpoint target + const Target * l_pDstTarget = i_target. + getAttr<ATTR_PEER_TARGET>(); + // If target is valid + if (l_pDstTarget) + { + // Deconfigure peer endpoint + HWAS_INF("deconfigByAssoc BUS Peer: %.8X", + get_huid(l_pDstTarget)); + _deconfigureTarget(const_cast<Target &> (*l_pDstTarget), + i_errlEid); + } + break; + } // TYPE_XBUS, TYPE_ABUS + default: + // no action break; - } // TYPE_XBUS, TYPE_ABUS - default: - // no action - break; - } // switch + } // switch + } // !i_atRunTime //HWAS_INF("deconfigByAssoc exiting: %.8X", get_huid(&i_target)); } // _deconfigByAssoc //****************************************************************************** -uint32_t DeconfigGard::getDeconfigureStatus() +uint32_t DeconfigGard::getDeconfigureStatus() const { // no lock needed - just return the value. uint32_t l_deconfigCount = iv_deconfigCount; |

