diff options
author | Chris Cain <cjcain@us.ibm.com> | 2017-06-27 12:03:44 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-07-20 16:39:02 -0400 |
commit | 40a026cea2d758722db27a254fec476b2f107d69 (patch) | |
tree | 6ece81f6ec0e09bba2dbfeed8c775de6f728ffeb /src/usr/htmgt | |
parent | c30be2b5469301e7269dc5689a70428e592f369f (diff) | |
download | talos-hostboot-40a026cea2d758722db27a254fec476b2f107d69.tar.gz talos-hostboot-40a026cea2d758722db27a254fec476b2f107d69.zip |
HTMGT: Prevent communication with OCC during OCC reset if comm not established
- during OCC reset, prevent sending poll/reset prep to OCC if communications
has never been successfully completed.
- fix elog leak
Change-Id: Ib154718834995401b585d584b8e2686c3b468873
CQ: SW390460
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42495
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@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>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Sheldon R. Bailey <baileysh@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt')
-rw-r--r-- | src/usr/htmgt/htmgt.C | 8 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occ.C | 39 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occ.H | 6 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_poll.C | 24 |
4 files changed, 56 insertions, 21 deletions
diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C index 7107d3e44..d7675bb56 100644 --- a/src/usr/htmgt/htmgt.C +++ b/src/usr/htmgt/htmgt.C @@ -56,6 +56,7 @@ namespace HTMGT i_startCompleted, i_failedOccTarget); errlHndl_t l_err = nullptr; uint32_t l_huid = 0; + bool skip_comm = true; if (i_failedOccTarget) { l_huid = TARGETING::get_huid(i_failedOccTarget); @@ -116,6 +117,7 @@ namespace HTMGT ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID); } } + skip_comm = false; // Send ALL config data sendOccConfigData(); @@ -193,7 +195,11 @@ namespace HTMGT "Attempting OCC Reset", l_err->reasonCode()); TMGT_INF("processOccStartStatus: Calling resetOccs"); - errlHndl_t err2 = OccManager::resetOccs(nullptr); + // Reset ALL OCCs, don't skip incrementing reset count, and + // if comm has not been established, don't try to talk to OCCs + errlHndl_t err2 = OccManager::resetOccs(nullptr, + false, + skip_comm); if(err2) { TMGT_ERR("OccManager::resetOccs failed with 0x%04X", diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C index 0d47926b6..c6d230fad 100644 --- a/src/usr/htmgt/htmgt_occ.C +++ b/src/usr/htmgt/htmgt_occ.C @@ -206,24 +206,28 @@ namespace HTMGT cmdData[1] = OCC_RESET_FAIL_OTHER_OCC; } - OccCmd cmd(this, OCC_CMD_RESET_PREP, sizeof(cmdData), cmdData); - err = cmd.sendOccCmd(); - if(err) + if (iv_commEstablished) { - // log error and keep going - TMGT_ERR("OCC::resetPrep: OCC%d resetPrep failed with rc = 0x%04x", - iv_instance, - err->reasonCode()); + OccCmd cmd(this, OCC_CMD_RESET_PREP, sizeof(cmdData), cmdData); + err = cmd.sendOccCmd(); + if(err) + { + // log error and keep going + TMGT_ERR("OCC::resetPrep: OCC%d resetPrep failed, rc=0x%04x", + iv_instance, + err->reasonCode()); - ERRORLOG::errlCommit(err, HTMGT_COMP_ID); - } + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } - // poll and flush error logs from OCC - Check Ex return code - err = pollForErrors(true); - if(err) - { - ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + // poll and flush error logs from OCC - Check Ex return code + err = pollForErrors(true); + if(err) + { + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } } + // else comm to OCC has not been established yet return atThreshold; } @@ -841,8 +845,11 @@ namespace HTMGT if (false == i_skipComm) { - // Send poll cmd to all OCCs to establish comm - err = _sendOccPoll(false,nullptr); + // Send poll cmd to all OCCs + err = _sendOccPoll(false, // don't flush errors + nullptr, // send to all OCCs + true); // only poll if communications + // has been established if (err) { TMGT_ERR("_resetOccs: Poll OCCs failed."); diff --git a/src/usr/htmgt/htmgt_occ.H b/src/usr/htmgt/htmgt_occ.H index 1c33cbbe4..73f081411 100644 --- a/src/usr/htmgt/htmgt_occ.H +++ b/src/usr/htmgt/htmgt_occ.H @@ -710,9 +710,13 @@ namespace HTMGT bool i_skipComm = false); /** See sendOccPoll() above */ + /* @param[in] i_onlyIfEstablished: If true, only send poll if + * communications has already been established + * with that OCC */ errlHndl_t _sendOccPoll(const bool i_flushAllErrors, - TARGETING::Target * i_occTarget); + TARGETING::Target * i_occTarget, + const bool i_onlyIfEstablished = false); /** See updateSafeModeReason() above */ void _updateSafeModeReason(uint32_t i_src, diff --git a/src/usr/htmgt/htmgt_poll.C b/src/usr/htmgt/htmgt_poll.C index a3d5d2238..2457db373 100644 --- a/src/usr/htmgt/htmgt_poll.C +++ b/src/usr/htmgt/htmgt_poll.C @@ -44,9 +44,10 @@ namespace HTMGT { errlHndl_t OccManager::_sendOccPoll(const bool i_flushAllErrors, - TARGETING::Target * i_occTarget) + TARGETING::Target * i_occTarget, + const bool onlyIfEstablished) { - errlHndl_t l_err = NULL; + errlHndl_t l_err = nullptr; TMGT_INF("sendOccPoll(flush=%c)", i_flushAllErrors?'y':'n'); @@ -54,7 +55,24 @@ namespace HTMGT { if(NULL == i_occTarget || l_occ->iv_target == i_occTarget) { - l_err = l_occ->pollForErrors(i_flushAllErrors); + if ((l_occ->iv_commEstablished) || + (onlyIfEstablished == false)) + { + errlHndl_t poll_err=l_occ->pollForErrors(i_flushAllErrors); + if (poll_err != nullptr) + { + if (l_err == nullptr) + { + // Only return 1st error (continue to poll others) + l_err = poll_err; + poll_err = nullptr; + } + else + { + ERRORLOG::errlCommit(poll_err, HTMGT_COMP_ID); + } + } + } } } |