diff options
author | Caleb Palmer <cnpalmer@us.ibm.com> | 2015-07-21 09:56:08 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-08-18 18:19:55 -0500 |
commit | 6ff3e00062b894a880937ce41f748e26105b579a (patch) | |
tree | 721792d9dfaa13ebab0935a3e820c346be25d6ea /src | |
parent | a85a8f8c44e76c0edfeca53835cebbc7d2fdd383 (diff) | |
download | talos-hostboot-6ff3e00062b894a880937ce41f748e26105b579a.tar.gz talos-hostboot-6ff3e00062b894a880937ce41f748e26105b579a.zip |
PRD: Improve MDIA Timeout Design
Change-Id: Ia622a1285469ffe405ec2ce7435f2445f8ec1ac7
RTC: 127342
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19199
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Tested-by: FSP CI Jenkins
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/usr/diag/mdia/mdiamonitor.H | 9 | ||||
-rw-r--r-- | src/usr/diag/mdia/mdiasm.C | 21 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/usr/diag/mdia/mdiamonitor.H b/src/usr/diag/mdia/mdiamonitor.H index eef7d2ebb..bc2b8b771 100755 --- a/src/usr/diag/mdia/mdiamonitor.H +++ b/src/usr/diag/mdia/mdiamonitor.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -86,6 +88,11 @@ class CommandMonitor */ virtual ~CommandMonitor(); + /** + * @brief invalid monitor id + */ + static const uint64_t INVALID_MONITOR_ID = 0; + protected: /** diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C index 4e5b6b85d..c879fc42b 100644 --- a/src/usr/diag/mdia/mdiasm.C +++ b/src/usr/diag/mdia/mdiasm.C @@ -819,9 +819,7 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp) mutex_lock(&iv_mutex); - uint64_t monitorId = getMonitor().addMonitor(mbaTO); - - i_wfp.timer = monitorId; + uint64_t monitorId = CommandMonitor::INVALID_MONITOR_ID; i_wfp.timeoutCnt = 0; // reset for new work item workItem = *i_wfp.workItem; restart = i_wfp.restartCommand; @@ -1010,10 +1008,17 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp) // Command and address configured. // Invoke the command. - fapirc = cmd->setupAndExecuteCmd(); err = fapiRcToErrl(fapirc); + // Start a timeout monitor + mutex_lock(&iv_mutex); + + monitorId = getMonitor().addMonitor(mbaTO); + i_wfp.timer = monitorId; + + mutex_unlock(&iv_mutex); + if(err) { MDIA_FAST("sm: setupAndExecuteCmd %p failed", cmd); @@ -1022,18 +1027,18 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp) } while(0); - mutex_lock(&iv_mutex); - if(err) { + mutex_lock(&iv_mutex); + MDIA_FAST("sm: Running Maint Cmd failed"); getMonitor().removeMonitor(monitorId); i_wfp.data = NULL; - } - mutex_unlock(&iv_mutex); + mutex_unlock(&iv_mutex); + } if(err && cmd) { |