summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt/htmgt_poll.C
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2015-09-04 10:18:52 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-09-18 20:37:54 -0500
commit978b2c75e301281fe4882dd30a2e365e6106faa4 (patch)
tree8897560408b39ba7418ebe775ebafd2037b49e83 /src/usr/htmgt/htmgt_poll.C
parentef63b1a277b8ad231b308c0c197d663bd4b0eb13 (diff)
downloadtalos-hostboot-978b2c75e301281fe4882dd30a2e365e6106faa4.tar.gz
talos-hostboot-978b2c75e301281fe4882dd30a2e365e6106faa4.zip
Prevent OCC exception from logging duplicate errors
Change-Id: I3262c42c906fc9cfa879e7df0e501e2f7fe1e2f3 CQ:SW320752 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20578 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: SHELDON R. BAILEY <baileysh@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt/htmgt_poll.C')
-rw-r--r--src/usr/htmgt/htmgt_poll.C130
1 files changed, 67 insertions, 63 deletions
diff --git a/src/usr/htmgt/htmgt_poll.C b/src/usr/htmgt/htmgt_poll.C
index 1b1cc7f1d..2bba2aca3 100644
--- a/src/usr/htmgt/htmgt_poll.C
+++ b/src/usr/htmgt/htmgt_poll.C
@@ -84,87 +84,91 @@ namespace HTMGT
errlHndl_t err = NULL;
uint8_t * poll_rsp = NULL;
- TMGT_INF("sendOccPoll: Polling OCC%d", iv_instance);
- bool continuePolling = false;
- size_t elogCount = 10;
-
- do
+ // Only send poll if OCC has not logged an exception
+ if (0 == iv_exceptionLogged)
{
- // create 1 byte buffer for poll command data
- const uint8_t l_cmdData[1] = { 0x10 /*version*/ };
+ TMGT_INF("sendOccPoll: Polling OCC%d", iv_instance);
+ bool continuePolling = false;
+ size_t elogCount = 10;
- OccCmd cmd(this,
- OCC_CMD_POLL,
- sizeof(l_cmdData),
- l_cmdData);
-
- err = cmd.sendOccCmd();
- if (err != NULL)
+ do
{
- // Poll failed
- TMGT_ERR("sendOccPoll: OCC%d poll failed with rc=0x%04X",
- iv_instance,
- err->reasonCode());
+ // create 1 byte buffer for poll command data
+ const uint8_t l_cmdData[1] = { 0x10 /*version*/ };
- continuePolling = false;
- }
- else
- {
- // Poll succeeded, check response
- uint32_t poll_rsp_size = cmd.getResponseData(poll_rsp);
- if (poll_rsp_size >= OCC_POLL_DATA_MIN_SIZE)
+ OccCmd cmd(this,
+ OCC_CMD_POLL,
+ sizeof(l_cmdData),
+ l_cmdData);
+
+ err = cmd.sendOccCmd();
+ if (err != NULL)
{
- if (i_flushAllErrors)
+ // Poll failed
+ TMGT_ERR("sendOccPoll: OCC%d poll failed with rc=0x%04X",
+ iv_instance,
+ err->reasonCode());
+
+ continuePolling = false;
+ }
+ else
+ {
+ // Poll succeeded, check response
+ uint32_t poll_rsp_size = cmd.getResponseData(poll_rsp);
+ if (poll_rsp_size >= OCC_POLL_DATA_MIN_SIZE)
{
- const occPollRspStruct_t *currentPollRsp =
- (occPollRspStruct_t *) poll_rsp;
- if (currentPollRsp->errorId != 0)
+ if (i_flushAllErrors)
{
- if (--elogCount > 0)
+ const occPollRspStruct_t *currentPollRsp =
+ (occPollRspStruct_t *) poll_rsp;
+ if (currentPollRsp->errorId != 0)
{
- // An error was returned, keep polling OCC
- continuePolling = true;
+ if (--elogCount > 0)
+ {
+ // An error was returned, keep polling OCC
+ continuePolling = true;
+ }
+ else
+ {
+ // Limit number of elogs retrieved so
+ // we do not get stuck in loop
+ TMGT_INF("sendOccPoll: OCC%d still has"
+ "more errors to report.",
+ iv_instance);
+ continuePolling = false;
+ }
}
else
{
- // Limit number of elogs retrieved so
- // we do not get stuck in loop
- TMGT_INF("sendOccPoll: OCC%d still has"
- "more errors to report.",
- iv_instance);
continuePolling = false;
}
}
- else
- {
- continuePolling = false;
- }
+ pollRspHandler(poll_rsp, poll_rsp_size);
+ }
+ else
+ {
+ TMGT_ERR("sendOccPoll: OCC%d poll command response "
+ "failed with invalid data length %d",
+ iv_instance, poll_rsp_size);
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_INVALID_LENGTH
+ * @moduleid HTMGT_MOD_OCC_POLL
+ * @userdata1 OCC instance
+ * @devdesc Invalid POLL response length
+ */
+ bldErrLog(err,
+ HTMGT_MOD_OCC_POLL,
+ HTMGT_RC_INVALID_LENGTH,
+ iv_instance, 0, 0, 0,
+ ERRORLOG::ERRL_SEV_INFORMATIONAL);
+
+ continuePolling = false;
}
- pollRspHandler(poll_rsp, poll_rsp_size);
}
- else
- {
- TMGT_ERR("sendOccPoll: OCC%d poll command response "
- "failed with invalid data length %d",
- iv_instance, poll_rsp_size);
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_INVALID_LENGTH
- * @moduleid HTMGT_MOD_OCC_POLL
- * @userdata1 OCC instance
- * @devdesc Invalid POLL response length
- */
- bldErrLog(err,
- HTMGT_MOD_OCC_POLL,
- HTMGT_RC_INVALID_LENGTH,
- iv_instance, 0, 0, 0,
- ERRORLOG::ERRL_SEV_INFORMATIONAL);
-
- continuePolling = false;
- }
}
+ while (continuePolling);
}
- while (continuePolling);
return err;
}
OpenPOWER on IntegriCloud