diff options
author | Caleb Palmer <cnpalmer@us.ibm.com> | 2017-07-27 09:13:13 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-07-31 13:50:53 -0400 |
commit | 7afc961159aa0cdb6f0a052d188b9af7081db83a (patch) | |
tree | e6bbb5cf97e1b6abd5f9b3abcabb285683f1286e | |
parent | c2078fece2770dcb181a8d8b6da600fba8fbe744 (diff) | |
download | talos-hostboot-7afc961159aa0cdb6f0a052d188b9af7081db83a.tar.gz talos-hostboot-7afc961159aa0cdb6f0a052d188b9af7081db83a.zip |
MDIA: Adjust maint cmd timeout value
Change-Id: I9e965e3ef99b016249d95ea933b7054899dc9b70
CQ: SW397102
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43747
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
-rw-r--r-- | src/usr/diag/mdia/mdiasm.C | 56 | ||||
-rw-r--r-- | src/usr/diag/mdia/mdiasm.H | 19 |
2 files changed, 60 insertions, 15 deletions
diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C index 40b7c316f..8b99272f8 100644 --- a/src/usr/diag/mdia/mdiasm.C +++ b/src/usr/diag/mdia/mdiasm.C @@ -236,6 +236,52 @@ fapi2::TargetType getMdiaTargetType() return targetType; } +uint64_t getTimeoutValue() +{ + // Out maintenance command timeout value will differ depending on a few + // conditions. This function will find the timeout value we need and + // return it. + + // Start with the default timeout value. + uint64_t timeout = MAINT_CMD_TIMEOUT; + + // If continuous tracing is enabled. + TargetHandle_t sys = nullptr; + targetService().getTopLevelTarget(sys); + HbSettings hbSettings = sys->getAttr<ATTR_HB_SETTINGS>(); + + if ( hbSettings.traceContinuous && timeout < MAINT_CMD_TIMEOUT_LONG ) + { + timeout = MAINT_CMD_TIMEOUT_LONG; + } + + // Nimbus DD1.0 workaround. + TARGETING::Target* masterProc = nullptr; + TARGETING::targetService().masterProcChipTargetHandle(masterProc); + + if ( MODEL_NIMBUS == masterProc->getAttr<ATTR_MODEL>() && + 0x10 == masterProc->getAttr<ATTR_EC>() && + timeout < MAINT_CMD_TIMEOUT_DD10 ) + { + timeout = MAINT_CMD_TIMEOUT_DD10; + } + + // Ensure that the MDIA timeout is less than the watchdog timer. + if ( timeout >= (IPMIWATCHDOG::DEFAULT_WATCHDOG_COUNTDOWN*NANOSEC_PER_SEC) ) + { + // If the watchdog timer for some reason happens to be 10 sec or less, + // just set the MDIA timeout to the watchdog timeout. + // Else set it to ten seconds lower than the watchdog timer. + timeout = ( IPMIWATCHDOG::DEFAULT_WATCHDOG_COUNTDOWN <= 10 ) + ? ( IPMIWATCHDOG::DEFAULT_WATCHDOG_COUNTDOWN * + NANOSEC_PER_SEC ) + : ( (IPMIWATCHDOG::DEFAULT_WATCHDOG_COUNTDOWN-10) * + NANOSEC_PER_SEC ); + } + + return timeout; +} + // Do the setup for CE thresholds errlHndl_t ceErrorSetup( TargetHandle_t i_mba ) { @@ -441,7 +487,7 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs) (*wit)->timeoutCnt); // register a new timeout monitor uint64_t monitorId = - getMonitor().addMonitor(MAINT_CMD_TIMEOUT); + getMonitor().addMonitor( getTimeoutValue() ); (*wit)->timer = monitorId; break; @@ -910,13 +956,7 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp) TargetHandle_t target; // starting a maint cmd ... register a timeout monitor - TargetHandle_t sys = nullptr; - targetService().getTopLevelTarget(sys); - - HbSettings hbSettings = sys->getAttr<ATTR_HB_SETTINGS>(); - - uint64_t maintCmdTO = - hbSettings.traceContinuous ? MAINT_CMD_TIMEOUT_LONG : MAINT_CMD_TIMEOUT; + uint64_t maintCmdTO = getTimeoutValue(); mutex_lock(&iv_mutex); diff --git a/src/usr/diag/mdia/mdiasm.H b/src/usr/diag/mdia/mdiasm.H index 5a304c1aa..5e076f5ea 100644 --- a/src/usr/diag/mdia/mdiasm.H +++ b/src/usr/diag/mdia/mdiasm.H @@ -41,18 +41,23 @@ namespace MDIA { +// Maint cmd timeout values are in nanosecs. This is just for easy conversions. +static const uint64_t NANOSEC_PER_SEC = 1000000000; + // HW timeout value - 30 secs -// Nimbus DD1.0 has a workaround that will go over 30 seconds. Will need to bump -// it up for now. May consider lowering it later, but only if there is a +static const uint64_t MAINT_CMD_TIMEOUT = 30 * NANOSEC_PER_SEC; + +// Nimbus DD1.0 has a workaround that will go over 30 seconds. Will bump it up +// to 110 secs for now. May consider lowering it later, but only if there is a // problem. -static const uint64_t MAINT_CMD_TIMEOUT = 30000000000 * 10; +static const uint64_t MAINT_CMD_TIMEOUT_DD10 = 110 * NANOSEC_PER_SEC; -//Longer MBA timeout to be used when continuous tracing is enabled - 30 min -static const uint64_t MAINT_CMD_TIMEOUT_LONG = 1800000000000; +// Longer MBA timeout to be used when continuous tracing is enabled - 30 min +static const uint64_t MAINT_CMD_TIMEOUT_LONG = 1800 * NANOSEC_PER_SEC; -//Commit an info log for SW timeout every 10 mins +// Commit an info log for SW timeout every 10 mins static const uint64_t MAINT_CMD_TIMEOUT_LOG = - ( 10 * 60000000000 ) / MAINT_CMD_TIMEOUT; + ( 600 * NANOSEC_PER_SEC ) / MAINT_CMD_TIMEOUT; /** * @brief work flow phases |