diff options
author | Brian Horton <brianh@linux.ibm.com> | 2013-04-04 11:18:29 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-05-06 14:27:25 -0500 |
commit | a11977819c36bdc208ea400c2701c9982b0a84d2 (patch) | |
tree | 3dcf37da99db6b73e322848cb2c1f1043497a314 /src | |
parent | 31267d99d061245ce7eebb1eb55465a56aa67113 (diff) | |
download | talos-hostboot-a11977819c36bdc208ea400c2701c9982b0a84d2.tar.gz talos-hostboot-a11977819c36bdc208ea400c2701c9982b0a84d2.zip |
Support Deconfigure By Association in HWAS functions.
. Add support for CHILD and CHILD_BY_AFFINITY targets to get
deconfigured when a target gets deconfigured.
. Add hwasState to store the PLID associated with an deconfigure
events (system error or GARD callout).
. Replace code in dmi_training to call deconfigureTarget instead
of explictly setting functional state.
Change-Id: I2e18b6a18eba5034dbf35a0bba669b5f4c171932
RTC: 35119
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4108
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@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/hwpf/istepreasoncodes.H | 1 | ||||
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 221 | ||||
-rw-r--r-- | src/usr/hwas/common/hwas.C | 61 | ||||
-rw-r--r-- | src/usr/hwas/test/hwas1test.H | 11 | ||||
-rw-r--r-- | src/usr/hwas/test/hwasGardTest.H | 4 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dmi_training/dmi_training.C | 69 | ||||
-rw-r--r-- | src/usr/targeting/common/test/testcommontargeting.H | 3 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 40 |
8 files changed, 274 insertions, 136 deletions
diff --git a/src/include/usr/hwpf/istepreasoncodes.H b/src/include/usr/hwpf/istepreasoncodes.H index 01099fb2e..80116af90 100644 --- a/src/include/usr/hwpf/istepreasoncodes.H +++ b/src/include/usr/hwpf/istepreasoncodes.H @@ -177,6 +177,7 @@ enum istepReasonCode ISTEP_LOAD_SLW_FROM_PNOR_FAILED = ISTEP_COMP_ID | 0x2E, ISTEP_PROC_GETECID_FAILED = ISTEP_COMP_ID | 0x2F, ISTEP_TOP_LEVEL_TARGET_NULL = ISTEP_COMP_ID | 0x30, + ISTEP_DECONFIGURE_MBA_FAILED = ISTEP_COMP_ID | 0x31, }; // end ISTEP } diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index e59badf7b..af2157395 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -133,7 +133,6 @@ 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); errlHndl_t l_pErr = NULL; GardRecords_t l_gardRecords; @@ -142,15 +141,16 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( // subset of Targets to deconfigure to give the best chance of IPL // This is known as Resource Recovery - // Get all GARD Records - l_pErr = _getGardRecords(GET_ALL_GARD_RECORDS, l_gardRecords); - - if (l_pErr) - { - HWAS_ERR("Error from _getGardRecords"); - } - else + HWAS_MUTEX_LOCK(iv_mutex); + do { + // Get all GARD Records + l_pErr = _getGardRecords(GET_ALL_GARD_RECORDS, l_gardRecords); + if (l_pErr) + { + HWAS_ERR("Error from _getGardRecords"); + break; + } HWAS_INF("%d GARD Records found", l_gardRecords.size()); // For each GARD Record @@ -181,15 +181,31 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( } } + // skip if not present + if (!l_pTarget->getAttr<TARGETING::ATTR_HWAS_STATE>().present) + { + HWAS_INF("skipping %.8X - target not present", + TARGETING::get_huid(l_pTarget)); + continue; + } + // Deconfigure the Target + // don't need to check ATTR_DECONFIG_GARDABLE -- if we get + // here, it's because of a gard record on this target _deconfigureTarget(*l_pTarget, (*l_itr).iv_errlogPlid, DECONFIG_CAUSE_GARD_RECORD); // Deconfigure other Targets by association _deconfigureByAssoc(*l_pTarget, (*l_itr).iv_errlogPlid); } + } // for + if (l_pErr) + { // if we broke out of the for loop, now break out of the do/while + break; } + } + while (0); HWAS_MUTEX_UNLOCK(iv_mutex); return l_pErr; @@ -200,16 +216,58 @@ errlHndl_t DeconfigGard::deconfigureTarget(TARGETING::Target & i_target, const uint32_t i_errlPlid) { HWAS_INF("Usr Request: Deconfigure Target"); - HWAS_MUTEX_LOCK(iv_mutex); + errlHndl_t l_pErr = NULL; - // Deconfigure the Target - _deconfigureTarget(i_target, i_errlPlid, DECONFIG_CAUSE_FIRMWARE_REQ); + do + { + const uint8_t lDeconfigGardable = + i_target.getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>(); + const uint8_t lPresent = + i_target.getAttr<TARGETING::ATTR_HWAS_STATE>().present; + if (!lDeconfigGardable || !lPresent) + { + // Target is not Deconfigurable. Create an error + HWAS_ERR("Target %.8X not Deconfigurable", + TARGETING::get_huid(&i_target)); - // Deconfigure other Targets by association - _deconfigureByAssoc(i_target, i_errlPlid); + /*@ + * @errortype + * @moduleid HWAS::MOD_DECONFIG_GARD + * @reasoncode HWAS::RC_TARGET_NOT_DECONFIGURABLE + * @devdesc Attempt to deconfigure a target that is not + * deconfigurable + * (not DECONFIG_GARDABLE or not present) + * @userdata1 HUID of input target // GARD errlog PLID + * @userdata2 ATTR_DECONFIG_GARDABLE // ATTR_HWAS_STATE.present + */ + const uint64_t userdata1 = + (static_cast<uint64_t>(TARGETING::get_huid(&i_target)) << 32) | + i_errlPlid; + const uint64_t userdata2 = + (static_cast<uint64_t>(lDeconfigGardable) << 32) | lPresent; + l_pErr = hwasError( + ERRL_SEV_INFORMATIONAL, + HWAS::MOD_DECONFIG_GARD, + HWAS::RC_TARGET_NOT_DECONFIGURABLE, + userdata1, + userdata2); + break; + } - HWAS_MUTEX_UNLOCK(iv_mutex); - return NULL; + // all ok - do the work + HWAS_MUTEX_LOCK(iv_mutex); + + // Deconfigure the Target + _deconfigureTarget(i_target, i_errlPlid, DECONFIG_CAUSE_FIRMWARE_REQ); + + // Deconfigure other Targets by association + _deconfigureByAssoc(i_target, i_errlPlid); + + HWAS_MUTEX_UNLOCK(iv_mutex); + } + + while (0); + return l_pErr; } //****************************************************************************** @@ -297,10 +355,48 @@ errlHndl_t DeconfigGard::getGardRecords( void DeconfigGard::_deconfigureByAssoc(TARGETING::Target & i_target, const uint32_t i_errlPlid) { - HWAS_INF("****TBD****: Deconfiguring by Association for: %.8X", + HWAS_INF("Deconfiguring by Association for: %.8X", TARGETING::get_huid(&i_target)); - // TODO + TARGETING::TargetHandleList pChildList; + TARGETING::PredicateHwas hwasPredicate; + hwasPredicate.reset().poweredOn(true).present(true).functional(true); + + // find all CHILD and CHILD_BY_AFFINITY matches for this target + // and deconfigure them + TARGETING::targetService().getAssociated( pChildList, &i_target, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &hwasPredicate); + for (TARGETING::TargetHandleList::iterator pChild_it = pChildList.begin(); + pChild_it != pChildList.end(); + ++pChild_it) + { + TARGETING::TargetHandle_t pChild = *pChild_it; + + if (pChild->getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>()) + { // only deconfigure targets that are able to be deconfigured + _deconfigureTarget(*pChild, i_errlPlid, + DECONFIG_CAUSE_DECONFIG_BY_ASSOC); + } + } // for CHILD + + TARGETING::targetService().getAssociated( pChildList, &i_target, + TARGETING::TargetService::CHILD_BY_AFFINITY, + TARGETING::TargetService::ALL, + &hwasPredicate); + for (TARGETING::TargetHandleList::iterator pChild_it = pChildList.begin(); + pChild_it != pChildList.end(); + ++pChild_it) + { + TARGETING::TargetHandle_t pChild = *pChild_it; + + if (pChild->getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>()) + { // only deconfigure targets that are able to be deconfigured + _deconfigureTarget(*pChild, i_errlPlid, + DECONFIG_CAUSE_DECONFIG_BY_ASSOC); + } + } // for CHILD_BY_AFFINITY } //****************************************************************************** @@ -308,58 +404,36 @@ void DeconfigGard::_deconfigureTarget(TARGETING::Target & i_target, const uint32_t i_errlPlid, const DeconfigCause i_cause) { - HWAS_INF("Deconfiguring Target %.8X", - TARGETING::get_huid(&i_target)); + HWAS_INF("Deconfiguring Target %.8X, errlPlid %X cause %d", + TARGETING::get_huid(&i_target), i_errlPlid, i_cause); - if (!i_target.getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>()) - { - // Target is not Deconfigurable. Commit an error - HWAS_ERR("Target %.8X not Deconfigurable", - TARGETING::get_huid(&i_target)); + // Set the Target state to non-functional. The assumption is that it is + // not possible for another thread (other than deconfigGard) to be + // updating HWAS_STATE concurrently. + TARGETING::HwasState l_state = + i_target.getAttr<TARGETING::ATTR_HWAS_STATE>(); - /*@ - * @errortype - * @moduleid HWAS::MOD_DECONFIG_GARD - * @reasoncode HWAS::RC_TARGET_NOT_DECONFIGURABLE - * @devdesc Attempt to deconfigure a target that is not - * deconfigurable - * @userdata1 HUID of input target / deconfigure errlog PLID - */ - const uint64_t userdata1 = - (static_cast<uint64_t> (TARGETING::get_huid(&i_target)) << 32) | - i_errlPlid; - errlHndl_t l_pErr = hwasError( - ERRL_SEV_INFORMATIONAL, - HWAS::MOD_DECONFIG_GARD, - HWAS::RC_TARGET_NOT_DECONFIGURABLE, - userdata1); - errlCommit(l_pErr,HWAS_COMP_ID); + if (!l_state.functional) + { + HWAS_DBG( + "Target HWAS_STATE already has functional=0; deconfiguredByPlid=0x%x", + l_state.deconfiguredByPlid); } else { - // Set the Target state to non-functional. The assumption is that it is - // not possible for another thread (other than deconfigGard) to be - // updating HWAS_STATE concurrently. - TARGETING::HwasState l_state = - i_target.getAttr<TARGETING::ATTR_HWAS_STATE>(); - - if (!l_state.functional) - { - HWAS_DBG("Target HWAS_STATE already non-functional"); - } - else - { - HWAS_INF("Setting Target HWAS_STATE to non-functional"); - l_state.functional = 0; - i_target.setAttr<TARGETING::ATTR_HWAS_STATE>(l_state); - } + HWAS_INF( + "Setting Target HWAS_STATE: functional=0, deconfiguredByPlid=0x%x", + i_errlPlid); + l_state.functional = 0; + l_state.deconfiguredByPlid = i_errlPlid; + i_target.setAttr<TARGETING::ATTR_HWAS_STATE>(l_state); + } - // Do any necessary Deconfigure Actions - _doDeconfigureActions(i_target); + // Do any necessary Deconfigure Actions + _doDeconfigureActions(i_target); - // Create a Deconfigure Record - _createDeconfigureRecord(i_target, i_errlPlid, i_cause); - } + // Create a Deconfigure Record + _createDeconfigureRecord(i_target, i_errlPlid, i_cause); } //****************************************************************************** @@ -502,7 +576,11 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, do { - if (!i_target.getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>()) + const uint8_t lDeconfigGardable = + i_target.getAttr<TARGETING::ATTR_DECONFIG_GARDABLE>(); + const uint8_t lPresent = + i_target.getAttr<TARGETING::ATTR_HWAS_STATE>().present; + if (!lDeconfigGardable || !lPresent) { // Target is not GARDable. Commit an error HWAS_ERR("Target not GARDable"); @@ -513,17 +591,21 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, * @reasoncode HWAS::RC_TARGET_NOT_GARDABLE * @devdesc Attempt to create a GARD Record for a target that * is not GARDable - * @userdata1 HUID of input target / GARD errlog PLID + * (not DECONFIG_GARDABLE or not present) + * @userdata1 HUID of input target // GARD errlog PLID + * @userdata2 ATTR_DECONFIG_GARDABLE // ATTR_HWAS_STATE.present */ const uint64_t userdata1 = (static_cast<uint64_t>(TARGETING::get_huid(&i_target)) << 32) | i_errlPlid; + const uint64_t userdata2 = + (static_cast<uint64_t>(lDeconfigGardable) << 32) | lPresent; l_pErr = hwasError( ERRL_SEV_UNRECOVERABLE, HWAS::MOD_DECONFIG_GARD, HWAS::RC_TARGET_NOT_GARDABLE, - userdata1); - errlCommit(l_pErr,HWAS_COMP_ID); + userdata1, + userdata2); break; } @@ -536,9 +618,8 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, break; } - GardRecord * l_pRecord = NULL; - // Find an empty GARD Record slot + GardRecord * l_pRecord = NULL; for (uint32_t i = 0; i < iv_maxGardRecords; i++) { if (iv_pGardRecords[i].iv_recordId == EMPTY_GARD_RECORDID) @@ -558,7 +639,7 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, * @reasoncode HWAS::RC_GARD_REPOSITORY_FULL * @devdesc Attempt to create a GARD Record and the GARD * Repository is full - * @userdata1 HUID of input target / GARD errlog PLID + * @userdata1 HUID of input target // GARD errlog PLID */ const uint64_t userdata1 = (static_cast<uint64_t> (TARGETING::get_huid(&i_target)) << 32) | diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index f0d10232a..7be663b63 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -62,16 +62,26 @@ TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 1024 ); * @brief simple helper fn to get and set hwas state to poweredOn, * present, functional * - * @param[in] i_target pointer to target that we're looking at - * @param[in] i_present boolean indicating present or not - * @param[in] i_functional boolean indicating functional or not + * @param[in] i_target pointer to target that we're looking at + * @param[in] i_present boolean indicating present or not + * @param[in] i_functional boolean indicating functional or not + * @param[in] i_errlPlid errplid that caused change to non-funcational; + * 0 if not associated with an error or if + * functional is true * * @return none * */ -void enableHwasState(Target *i_target, bool i_present, bool i_functional) +void enableHwasState(Target *i_target, + bool i_present, bool i_functional, + uint32_t i_errlPlid) { - HwasState hwasState = i_target->getAttr<ATTR_HWAS_STATE>(); + HwasState hwasState = i_target->getAttr<ATTR_HWAS_STATE>(); + + if (i_functional == false) + { // record the PLID as a reason that we're marking non-functional + hwasState.deconfiguredByPlid = i_errlPlid; + } hwasState.poweredOn = true; hwasState.present = i_present; hwasState.functional = i_functional; @@ -90,6 +100,7 @@ errlHndl_t discoverTargets() ++target) { HwasState hwasState = target->getAttr<ATTR_HWAS_STATE>(); + hwasState.deconfiguredByPlid = 0; hwasState.poweredOn = false; hwasState.present = false; hwasState.functional = false; @@ -99,11 +110,12 @@ errlHndl_t discoverTargets() // ASSUMPTIONS: // CLASS_SYS (exactly 1) - mark as present - // CLASS_ENC (>=1) - mark as present - // TYPE_PROC TYPE_MEMBUF TYPE_DIMM (ALL require hardware query) - // - call platPresenceDetect + // CLASS_ENC and + // CLASS_CHIP - (TYPE_PROC TYPE_MEMBUF) + // CLASS_LOGICAL_CARD - TYPE_DIMM + // (ALL require hardware query) + // - call platPresenceDetect // \->children: CLASS_* (NONE require hardware query) - mark as present - do { // find CLASS_SYS (the top level target) @@ -114,7 +126,7 @@ errlHndl_t discoverTargets() "HWAS discoverTargets: no CLASS_SYS TopLevelTarget found"); // mark this as present - enableHwasState(pSys, true, true); + enableHwasState(pSys, true, true, 0); HWAS_DBG("pSys %.8X - marked present", pSys->getAttr<ATTR_HUID>()); @@ -155,7 +167,7 @@ errlHndl_t discoverTargets() // if CLASS_ENC is still in this list, mark as present if (pTarget->getAttr<ATTR_CLASS>() == CLASS_ENC) { - enableHwasState(pTarget, true, true); + enableHwasState(pTarget, true, true, 0); HWAS_DBG("pTarget %.8X - CLASS_ENC marked present", pTarget->getAttr<ATTR_HUID>()); @@ -163,8 +175,9 @@ errlHndl_t discoverTargets() continue; } - bool chipFunctional = true; bool chipPresent = true; + bool chipFunctional = true; + uint32_t errlPlid = 0; uint16_t pgData[VPD_CP00_PG_DATA_LENGTH / sizeof(uint16_t)]; bzero(pgData, sizeof(pgData)); if (pTarget->getAttr<ATTR_CLASS>() == CLASS_CHIP) @@ -174,9 +187,10 @@ errlHndl_t discoverTargets() if (errl) { // read of ID/EC failed even tho we were present.. - HWAS_INF("pTarget %.8X - read IDEC failed - bad", - pTarget->getAttr<ATTR_HUID>()); + HWAS_INF("pTarget %.8X - read IDEC failed (plid 0x%X) - bad", + errl->plid(), pTarget->getAttr<ATTR_HUID>()); chipFunctional = false; + errlPlid = errl->plid(); // commit the error but keep going errlCommit(errl, HWAS_COMP_ID); @@ -190,9 +204,10 @@ errlHndl_t discoverTargets() if (errl) { // read of PG failed even tho we were present.. - HWAS_INF("pTarget %.8X - read PG failed - bad", - pTarget->getAttr<ATTR_HUID>()); + HWAS_INF("pTarget %.8X - read PG failed (plid 0x%X)- bad", + errl->plid(), pTarget->getAttr<ATTR_HUID>()); chipFunctional = false; + errlPlid = errl->plid(); // commit the error but keep going errlCommit(errl, HWAS_COMP_ID); @@ -353,7 +368,8 @@ errlHndl_t discoverTargets() } // chipFunctional // for sub-parts, if it's not functional, it's not present. - enableHwasState(pDesc, descFunctional, descFunctional); + enableHwasState(pDesc, descFunctional, descFunctional, + errlPlid); HWAS_DBG("pDesc %.8X - marked %spresent, %sfunctional", pDesc->getAttr<ATTR_HUID>(), descFunctional ? "" : "NOT ", @@ -361,20 +377,13 @@ errlHndl_t discoverTargets() } // set HWAS state to show CHIP is present, functional per above - enableHwasState(pTarget, chipPresent, chipFunctional); + enableHwasState(pTarget, chipPresent, chipFunctional, errlPlid); } // for pTarget_it } while (0); - if (errl == NULL) - { - HWAS_INF("discoverTargets exit with no error"); - } - else - { - HWAS_ERR("discoverTargets returning errl %p", errl); - } + HWAS_INF("discoverTargets returning errl %p", errl); return errl; } // discoverTargets diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H index 7da6eb761..b5076b59c 100644 --- a/src/usr/hwas/test/hwas1test.H +++ b/src/usr/hwas/test/hwas1test.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -77,6 +77,7 @@ public: // modify state l_hwasState = l_pTarget->getAttr<ATTR_HWAS_STATE>(); + l_hwasState.deconfiguredByPlid = 0x12345678; l_hwasState.poweredOn = true; l_hwasState.present = true; l_hwasState.functional = true; @@ -86,6 +87,14 @@ public: l_pTarget->setAttr<ATTR_HWAS_STATE>( l_hwasState ); // fetch and test new values + if ( l_pTarget->getAttr<ATTR_HWAS_STATE>().deconfiguredByPlid + != 0x12345678 ) + { + TS_FAIL( " deconfiguredByPlid = 0x%x, should be 0x12345678", + l_pTarget->getAttr<ATTR_HWAS_STATE>(). + deconfiguredByPlid ); + } + if ( l_pTarget->getAttr<ATTR_HWAS_STATE>().poweredOn != true ) { TS_FAIL( "poweredOn = 0x%x, should be true", diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 575b246db..4ec1b0315 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -281,7 +281,7 @@ public: l_pTarget->getAttr<TARGETING::ATTR_HWAS_STATE>(); // Deconfigure the chip. Production code will pass a valid PLID - l_pErr = HWAS::theDeconfigGard().deconfigureTarget(*l_pTarget, 0); + l_pErr = HWAS::theDeconfigGard().deconfigureTarget(*l_pTarget, 0xA); if (l_pErr) { @@ -290,7 +290,7 @@ public: } // Deconfigure the chip again - l_pErr = HWAS::theDeconfigGard().deconfigureTarget(*l_pTarget, 0); + l_pErr = HWAS::theDeconfigGard().deconfigureTarget(*l_pTarget, 0xB); if (l_pErr) { diff --git a/src/usr/hwpf/hwp/dmi_training/dmi_training.C b/src/usr/hwpf/hwp/dmi_training/dmi_training.C index 594b4277d..bd338e90e 100644 --- a/src/usr/hwpf/hwp/dmi_training/dmi_training.C +++ b/src/usr/hwpf/hwp/dmi_training/dmi_training.C @@ -51,6 +51,7 @@ #include <hwpisteperror.H> #include <errl/errludtarget.H> +#include <hwas/common/deconfigGard.H> // targeting support. #include <targeting/common/commontargeting.H> @@ -99,7 +100,6 @@ void* call_mss_getecid( void *io_pArgs ) uint8_t l_ddr_port_status = 0; uint8_t l_cache_enable = 0; uint8_t l_centaur_sub_revision = 0; - mss_get_cen_ecid_ddr_status l_mbaBadMask[2] = { MSS_GET_CEN_ECID_DDR_STATUS_MBA0_BAD, @@ -196,35 +196,54 @@ void* call_mss_getecid( void *io_pArgs ) // set to nonfunctional. if ( l_ddr_port_status & l_mbaBadMask[l_pos] ) { - // Get the mba's state - TARGETING::HwasState l_hwasState = - l_pMBA->getAttr<ATTR_HWAS_STATE>(); - - // Set to nonfunctional - l_hwasState.functional = false; - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Setting MBA%c to nonfunctional", l_pos ); - - l_pMBA->setAttr<ATTR_HWAS_STATE>(l_hwasState); - + // call HWAS to deconfigure this target + l_err = HWAS::theDeconfigGard().deconfigureTarget( + *l_pMBA, 0); l_num_func_mbas--; + + if (l_err) + { + // shouldn't happen, but if it does, stop trying to + // deconfigure targets.. + break; + } } + } // for + + // If there are no functional MBAs for this Centaur, deconfigure + // the Centaur as well + // TODO: RTC: 63225 + // this will go away when deconfigureByAssocation() handles this. + if (!l_err && (0 == l_num_func_mbas)) + { + // call HWAS to deconfigure this target + l_err = HWAS::theDeconfigGard().deconfigureTarget( + *l_pCentaur, 0); } - // If there are no functional MBAs for this Centaur, set the - // Centaur to nonfunctional as well - if (0 == l_num_func_mbas) + if (l_err) { - // Get the Centaur's state - TARGETING::HwasState l_hwasState = - l_pCentaur->getAttr<ATTR_HWAS_STATE>(); + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR: error deconfiguring MBA or Centaur"); - // Set to nonfunctional - l_hwasState.functional = false; - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Setting Centaur to nonfunctional" ); + /*@ + * @errortype + * @reasoncode ISTEP_DECONFIGURE_MBA_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_MSS_GETECID + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to deconfigure MBA or Centaur failed + * see error log in the user details section for + * additional details. + */ + l_StepError.addErrorDetails(ISTEP_DECONFIGURE_MBA_FAILED, + ISTEP_MSS_GETECID, + l_err ); - l_pCentaur->setAttr<ATTR_HWAS_STATE>(l_hwasState); + errlCommit( l_err, HWPF_COMP_ID ); } } @@ -423,7 +442,7 @@ void* call_dmi_erepair( void *io_pArgs ) ATTR_CHIP_UNIT_type l_mcsNum = l_mcs_target->getAttr<ATTR_CHIP_UNIT>(); // find all the Centaurs that are associated with this MCS - getChildAffinityTargets(l_memTargetList, l_mcs_target, + getChildAffinityTargets(l_memTargetList, l_mcs_target, CLASS_CHIP, TYPE_MEMBUF); if(l_memTargetList.size() != EREPAIR_MAX_CENTAUR_PER_MCS) @@ -846,7 +865,7 @@ void* call_proc_cen_framelock( void *io_pArgs ) // find all the Centaurs that are associated with this MCS TARGETING::TargetHandleList l_memTargetList; - getChildAffinityTargets(l_memTargetList, l_mcs_target, + getChildAffinityTargets(l_memTargetList, l_mcs_target, CLASS_CHIP, TYPE_MEMBUF); for (TargetHandleList::const_iterator diff --git a/src/usr/targeting/common/test/testcommontargeting.H b/src/usr/targeting/common/test/testcommontargeting.H index 90681c12a..d2420c21d 100644 --- a/src/usr/targeting/common/test/testcommontargeting.H +++ b/src/usr/targeting/common/test/testcommontargeting.H @@ -629,7 +629,8 @@ class CommonTargetingTestSuite: public CxxTest::TestSuite hwasPredicate.reset().poweredOn(true).present(true).functional(false); hwasPredicate.changedSinceLastIpl(true).dumpFunctional(false); - ATTR_HWAS_STATE_type allFiveHwasState = {true,true,false,true,false}; + ATTR_HWAS_STATE_type allFiveHwasState = + { 0x0,true,true,false,true,false}; l_pTopLevel->setAttr<ATTR_HWAS_STATE>(allFiveHwasState); if(!hwasPredicate(l_pTopLevel)) { diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 5bb2fc92e..06869c3ff 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -762,43 +762,61 @@ Keeps track of Target values poweredOn, present, functional, and changedSinceLastIPL</description> <complexType> - <description>struct - so far contains 5 booleans</description> + <description>struct - 5 booleans and a PLID</description> + <field> + <name>deconfiguredByPlid</name> + <description>if this target was deconfigured, + this will be the errlog PLID that caused it, + either by direct DECONFIG or _BY_ASSOCIATION.</description> + <type>uint32_t</type> + <default>0</default> + </field> <field> <name>poweredOn</name> - <description>boolean: Target is powered on, or Not. - comes up as powered off.</description> + <description> + 0b0: Target is not powered on (is off); + 0b1: Target is powered on; + </description> <type>uint8_t</type> <bits>1</bits> <default>0</default> </field> <field> <name>present</name> - <description>Target is present in the system. - comes up as Not PRESENT. </description> + <description> + 0b0: Target is not present in the system; + 0b1: Target is present in the system + </description> <type>uint8_t</type> <bits>1</bits> <default>0</default> </field> <field> <name>functional</name> - <description>Target is Functional. - comes up as Not FUNCTIONAL </description> + <description> + 0b0: Target is not functional; + 0b1: Target is functional + </description> <type>uint8_t</type> <bits>1</bits> <default>0</default> </field> <field> <name>changedSinceLastIPL</name> - <description>Target has changed since last IPL. - comes up as FALSE. </description> + <description> + 0b0: Target has not changed (replaced, re-seated) since last IPL; + 0b1: Target has changed (replaced, re-seated) since last IPL; + </description> <type>uint8_t</type> <bits>1</bits> <default>0</default> </field> <field> <name>dumpfunctional</name> - <description>FSP Only, used by DUMP applet to indicate targets dump capability. - Comes up as 0 which indicates the target is not dump capable</description> + <description>FSP Only, used by DUMP applet; + 0b0: target is dump capabile; + 0b1: target is not dump capabile; + </description> <type>uint8_t</type> <bits>1</bits> <default>0</default> |