diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2016-08-06 13:37:39 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-07 09:09:38 -0500 |
commit | 6e0b34872da165a1c30609d3e9d6cfbd70418507 (patch) | |
tree | 1da665e0024724133d96d665505d6dcc66026bc3 /src/usr/initservice/istepdispatcher | |
parent | f986133a26546254d64e65e30b00ae7f0d561ec9 (diff) | |
download | talos-hostboot-6e0b34872da165a1c30609d3e9d6cfbd70418507.tar.gz talos-hostboot-6e0b34872da165a1c30609d3e9d6cfbd70418507.zip |
OP820:OPRASGS:Garrison:Hostboot IPL fails to halt during shutdown reconfig
-Added the ability to notify the istep dispacher discontinue
executing isteps
-Added call to stopIpl() api in sbe update path
-Added internal graceful reboot request for SBE update and
reconfigure re-ipl usage
Change-Id: I5682992802b0f373df91378a38187d032bb3a0b4
CQ:SW361886
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27959
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@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: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28574
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/istepdispatcher')
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 94 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 23 |
2 files changed, 105 insertions, 12 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index a963b5832..76c0762b1 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -66,7 +66,7 @@ #include <pnor/pnorif.H> #include <ipmi/ipmiwatchdog.H> //IPMI watchdog timer #include <ipmi/ipmipowerstate.H> //IPMI System ACPI Power State -#include <ipmi/ipmichassiscontrol.H> +#include <ipmi/ipmichassiscontrol.H> #include <config.h> #include <ipmi/ipmisensor.H> #include <ipmi/ipmiif.H> @@ -116,7 +116,8 @@ IStepDispatcher::IStepDispatcher() : iv_istepToCompleteBeforeShutdown(0), iv_substepToCompleteBeforeShutdown(0), iv_acceptIstepMessages(true), - iv_newGardRecord(false) + iv_newGardRecord(false), + iv_stopIpl(false) { mutex_init(&iv_bkPtMutex); @@ -377,6 +378,25 @@ errlHndl_t IStepDispatcher::executeAllISteps() substep = 0; while (substep < g_isteps[istep].numitems) { + if( iv_stopIpl == true ) + { +#ifdef CONFIG_BMC_IPMI + // if we came in here and we are connected to a BMC, then + // we are in the process of an orderly shutdown, reset the + // watchdog to give ample time for the graceful shutdown + // to proceed. + errlHndl_t err_ipmi = IPMIWATCHDOG::resetWatchDogTimer(); + if(err_ipmi) + { + TRACFCOMP(g_trac_initsvc, + "init: ERROR: reset IPMI watchdog Failed"); + err_ipmi->collectTrace("INITSVC", 1024); + errlCommit(err_ipmi, INITSVC_COMP_ID ); + } +#endif + stop(); + } + err = doIstep(istep, substep, l_doReconfig); if (l_doReconfig) @@ -564,26 +584,24 @@ errlHndl_t IStepDispatcher::executeAllISteps() "not increment reboot count."); } + // discontinue isteps + iv_stopIpl = true; + // Request BMC to do power cycle that sends shutdown // and reset the host - err = IPMI::chassisControl - (IPMI::CHASSIS_POWER_CYCLE); - if (err) - { - TRACFCOMP(g_trac_initsvc, ERR_MRK - "FAIL executing chassisControl command"); - break; - } + requestReboot(); + #endif #ifdef CONFIG_CONSOLE CONSOLE::displayf(NULL, "System Shutting Down " - "To Perform Reconfiguration\n"); + "To Perform Reconfiguration"); CONSOLE::flush(); #endif #ifndef CONFIG_BMC_IPMI shutdownDuringIpl(); #endif + } } // else return the error from doIstep @@ -616,6 +634,29 @@ errlHndl_t IStepDispatcher::executeAllISteps() return err; } + + +//----------------------------------------------------------------------------- +// IStepDispatcher::stop() +// --------------------------------------------------------------------------- +void IStepDispatcher::stop() +{ + +#ifdef CONFIG_CONSOLE + CONSOLE::displayf(NULL,"Stopping istep dispatcher"); + CONSOLE::flush(); +#endif + + TRACFCOMP(g_trac_initsvc, "IStepDispatcher::stop() - Stopping istep" + "dispatcher."); + + printk( "IStepDispatcher stopping" ); + while(1) + { + task_yield(); + } +} + // ---------------------------------------------------------------------------- // IStepDispatcher::doIstep() // ---------------------------------------------------------------------------- @@ -1333,7 +1374,12 @@ void IStepDispatcher::handleShutdownMsg(msg_t * & io_pMsg) TRACFCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::handleShutdownMsg"); } - +#ifdef CONFIG_BMC_IPMI +void IStepDispatcher::requestReboot() +{ + IPMI::initiateReboot(); +} +#endif // ---------------------------------------------------------------------------- // IStepDispatcher::shutdownDuringIpl() // ---------------------------------------------------------------------------- @@ -1387,6 +1433,20 @@ void IStepDispatcher::shutdownDuringIpl() } } +// ----------------------------------------------------------------------------- +// IStepDispatcher::setStopIpl() +// ----------------------------------------------------------------------------- +void IStepDispatcher::setStopIpl() +{ + TRACDCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::setStopIpl"); + + mutex_lock(&iv_mutex); + iv_stopIpl = true; + mutex_unlock(&iv_mutex); + + TRACDCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::setStopIpl"); + return; +} // ---------------------------------------------------------------------------- // IStepDispatcher::iStepBreakPoint() @@ -2008,6 +2068,16 @@ void setNewGardRecord() { return IStepDispatcher::getTheInstance().setNewGardRecord(); } +#ifdef CONFIG_BMC_IPMI +void requestReboot() +{ + IStepDispatcher::getTheInstance().requestReboot(); +} +#endif +void stopIpl() +{ + return IStepDispatcher::getTheInstance().setStopIpl(); +} // ---------------------------------------------------------------------------- // IStepDispatcher::getIstepInfo() diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index 186639fa6..2ef7c75a8 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -203,6 +203,25 @@ public: */ void setNewGardRecord(); + /** + * @brief This function will set a boolean true which tells the istep + * dispacher to stop executing steps + */ + void setStopIpl(); + + /** + * @brief This function will stop the istep dispacher from continuing to + * execute steps + */ + void stop(); +#ifdef CONFIG_BMC_IPMI + /** + * @brief This function will trigger a reboot via ipmi commands + */ + void requestReboot(); +#endif + + protected: /** @@ -424,6 +443,10 @@ private: // Instance variable to state if a new gard record was committed bool iv_newGardRecord; + // Instance variable to state if a power off is in progress and + // the istep dispatcher should stop executing steps + bool iv_stopIpl; + // Message Queue for receiving message from SP or SPless user console msg_q_t iv_msgQ; |