diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2018-06-27 11:21:53 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-07-24 11:25:09 -0500 |
commit | d1c85ffcab108ee526f5a0c91ce3c15996541633 (patch) | |
tree | cdd4c9f2398c28fe2478bd55fb0abfa248c8ff20 | |
parent | 98e6e05479d562eb91cf5436bd8bea6256a88bb9 (diff) | |
download | blackbird-hostboot-d1c85ffcab108ee526f5a0c91ce3c15996541633.tar.gz blackbird-hostboot-d1c85ffcab108ee526f5a0c91ce3c15996541633.zip |
HTMGT: Save WOF reset reasons across all WOF resets
-Add query command to retrieve these reset reasons
Change-Id: I55436031b73eff95ec7e69020050dad556f4809a
RTC:192844
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/61903
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/usr/htmgt/htmgt.C | 8 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occ.C | 67 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occ.H | 23 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_utility.H | 1 | ||||
-rw-r--r-- | src/usr/htmgt/occError.C | 23 |
5 files changed, 105 insertions, 17 deletions
diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C index 83fcd4e51..4e6abbe77 100644 --- a/src/usr/htmgt/htmgt.C +++ b/src/usr/htmgt/htmgt.C @@ -727,6 +727,14 @@ namespace HTMGT } break; + + + case PASSTHRU_WOF_RESET_REASONS: + TMGT_INF("passThruCommand: Query WOF Reset Reasons"); + OccManager::getWOFResetReasons(o_rspLength, o_rspData); + break; + + case PASSTHRU_OCC_CFG_DATA: if (i_cmdLength == 3) { diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C index 8c081f2f6..c5fd57885 100644 --- a/src/usr/htmgt/htmgt_occ.C +++ b/src/usr/htmgt/htmgt_occ.C @@ -60,6 +60,7 @@ namespace HTMGT iv_needsReset(false), iv_needsWofReset(false), iv_wofResetCount(0), + iv_wofResetReasons(0), iv_failed(false), iv_seqNumber(0), iv_homer(i_homer), @@ -1336,7 +1337,7 @@ namespace HTMGT (0 == safeMode)) { // Make sure OCCs were built first (so data is valid) - errlHndl_t err = _buildOccs(); // if not a already built. + errlHndl_t err = _buildOccs(); // if not already built. if (err) { TMGT_ERR("_getOccData: failed to build OCC structures " @@ -1396,6 +1397,35 @@ namespace HTMGT o_length = index; } + // Get WOF Reset reasons for all OCCs + // NOTE: Data returned is of the form [ 1-byte ID | 4-byte bit vector] + // per OCC instance found + void OccManager::_getWOFResetReasons(uint16_t & o_length, + uint8_t * o_data) + { + uint16_t index = 0; + + // Make sure OCCs were built first (so data is valid) + errlHndl_t l_err = _buildOccs(); // if not already built. + if( l_err ) + { + TMGT_ERR("_getWOFResetReasons: Failed to build OCC structures " + "rc=0x%04X", l_err->reasonCode()); + ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID); + } + + // Iterate through OCC objects to get bit vectors. + for( const auto & occ : iv_occArray ) + { + o_data[index++] = occ->getInstance(); + UINT32_PUT(&o_data[index], occ->getWofResetReasons()); + index += 4; + } + + o_length = index; + } + + // Set default pstate table type and reset all OCCs to pick them up errlHndl_t OccManager::_loadPstates(bool i_normalPstates) @@ -1456,36 +1486,39 @@ namespace HTMGT { sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); } - for( const auto & occ : iv_occArray ) { - if (occ->iv_resetCount != 0) + if ( occ->iv_resetCount != 0 ) { TMGT_INF("_clearResetCounts: Clearing OCC%d reset count " "(was %d)", occ->getInstance(), occ->iv_resetCount); occ->iv_resetCount = 0; - if (safeMode) - { - // Clear OCC flags (failed, commEstablished, etc) - occ->postResetClear(); - } } - if(occ->iv_wofResetCount != 0) + if( occ->iv_wofResetCount != 0 ) { occ->iv_wofResetCount = 0; TMGT_INF("_clearResetCounts: Clearing OCC%d WOF reset count " "( was %d)", occ->getInstance(), occ->iv_wofResetCount); - if(safeMode) - { - // Clear OCC flags - occ->postResetClear(); - } } + + if( occ->iv_wofResetReasons != 0 ) + { + TMGT_INF("_clearResetCounts: Clearing OCC%d WOF reset reasons " + "( was 0x%08x)", + occ->getInstance(), + occ->iv_wofResetReasons ); + } + if( safeMode ) + { + // Clear OCC flags (failed, commEstablished, etc) + occ->postResetClear(); + } + } if (iv_sysResetCount != 0) @@ -1584,6 +1617,12 @@ namespace HTMGT Singleton<OccManager>::instance()._getOccData(o_length, o_data); } + void OccManager::getWOFResetReasons(uint16_t & o_length, uint8_t * o_data) + { + Singleton<OccManager>::instance()._getWOFResetReasons(o_length, + o_data); + } + errlHndl_t OccManager::loadPstates(bool i_normalPstates) { return Singleton<OccManager>::instance()._loadPstates(i_normalPstates); diff --git a/src/usr/htmgt/htmgt_occ.H b/src/usr/htmgt/htmgt_occ.H index 40f564fcf..c712fe526 100644 --- a/src/usr/htmgt/htmgt_occ.H +++ b/src/usr/htmgt/htmgt_occ.H @@ -276,6 +276,14 @@ namespace HTMGT /** + * @brief Returns a bit vector representing aggregate WOF + * resets reasons + * + * @return WOF Reset reason bit vector + */ + uint32_t getWofResetReasons() { return iv_wofResetReasons; } + + /** * @brief Return OCCs present bits * * @return bitmask representing this OCC position @@ -385,6 +393,8 @@ namespace HTMGT bool iv_needsWofReset; // WOF reset count uint8_t iv_wofResetCount; + // WOF reset reason. Aggregate across all WOF resets until cleared. + uint32_t iv_wofResetReasons; // true if OCC failed bool iv_failed; // Sequence number of last/current OCC command @@ -604,6 +614,16 @@ namespace HTMGT */ static void getOccData(uint16_t & o_length, uint8_t *o_data); + /** + * @brief Collect WOF reset reasons for ALL OCCs + * + * @param[out] o_length Length of data returned in o_data + * @param[out] o_data Buffer containing all OCCs 32-bit + * WOF reset reason vector preceded by + * their instanceId + */ + static void getWOFResetReasons(uint16_t & o_length, + uint8_t * o_data); /** * @brief Load specified pstate tables for all OCCs. @@ -771,6 +791,9 @@ namespace HTMGT /** See getOccData() above */ void _getOccData(uint16_t & o_length, uint8_t *o_data); + /** See getWOFResetReasons above */ + void _getWOFResetReasons(uint16_t & o_length, uint8_t *o_data); + /** See loadPstates() above */ errlHndl_t _loadPstates(bool i_normalPstates); diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H index e119a611a..6b16adfd7 100644 --- a/src/usr/htmgt/htmgt_utility.H +++ b/src/usr/htmgt/htmgt_utility.H @@ -174,6 +174,7 @@ namespace HTMGT //HOLD for future need. PASSTHRU_QUERY_MODE_FUNCTION = 0x07, PASSTHRU_ENA_DIS_OPAL_STATE = 0x08, PASSTHRU_SET_OCC_STATE = 0x09, + PASSTHRU_WOF_RESET_REASONS = 0x0A, PASSTHRU_OCC_CFG_DATA = 0x0C, }; diff --git a/src/usr/htmgt/occError.C b/src/usr/htmgt/occError.C index 15e8a48bb..e491009d6 100644 --- a/src/usr/htmgt/occError.C +++ b/src/usr/htmgt/occError.C @@ -109,6 +109,11 @@ namespace HTMGT TMGT_BIN("OCC ELOG", l_occElog, 256); + + // Get user details section + const occErrlUsrDtls_t *l_usrDtls_ptr = (occErrlUsrDtls_t *) + ((uint8_t*)l_occElog + sizeof(occErrlEntry_t)); + const uint32_t l_occSrc = OCCC_COMP_ID | l_occElog->reasonCode; ERRORLOG::errlSeverity_t severity = ERRORLOG::ERRL_SEV_INFORMATIONAL; @@ -130,13 +135,27 @@ namespace HTMGT bool l_occReset = false; elogProcessActions(l_occElog->actions, l_occReset, severity); + + + // Need to add WOF reason code to OCC object regardless of + // whether WOF resets are disabled. + if( l_occElog->actions & TMGT_ERRL_ACTIONS_WOF_RESET_REQUIRED ) + { + iv_wofResetReasons |= l_usrDtls_ptr->userData1; + TMGT_ERR("WOF Reset Reasons for OCC%d = 0x%08x", + iv_instance, + iv_wofResetReasons); + + } + // Check if we need a WOF requested reset if(iv_needsWofReset == true) { TMGT_ERR("WOF Reset detected! SRC = 0x%X", l_occSrc); + // We compare against one less than the threshold because - // the WOF reset count doesnt get incremented until resetPrep + // the WOF reset count doesn't get incremented until resetPrep if( iv_wofResetCount < (WOF_RESET_COUNT_THRESHOLD-1) ) { // Not at WOF reset threshold yet. Set sev to INFO @@ -156,8 +175,6 @@ namespace HTMGT // srcs which have similar uniqueness // NOTE: SRC tags are NOT required here as these logs will get // parsed with the OCC src tags - const occErrlUsrDtls_t *l_usrDtls_ptr = (occErrlUsrDtls_t *) - ((uint8_t*)l_occElog + sizeof(occErrlEntry_t)); bldErrLog(l_errlHndl, (htmgtModuleId)(l_usrDtls_ptr->modId & 0x00FF), (htmgtReasonCode)l_occSrc, // occ reason code |