diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2018-10-29 11:35:35 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-11-02 17:00:51 -0500 |
commit | 1e21ee6d26e5b73e624e2dfd4951d3e820411798 (patch) | |
tree | 1698f19126089849cf4c82acb9faa3e31cf54ecc /src/usr/initservice | |
parent | 25102e0add227ca3bd781fe33cb8fba8d65394c3 (diff) | |
download | talos-hostboot-1e21ee6d26e5b73e624e2dfd4951d3e820411798.tar.gz talos-hostboot-1e21ee6d26e5b73e624e2dfd4951d3e820411798.zip |
Allow stopIPL to be called before istepdispatcher is loaded
Hostboot was crashing because a graceful shutdown was requested
before libistepdisp.so loaded.
Change-Id: Id9206961bcbb72094ff359f26db720b92480f5fb
CQ: SW445973
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68110
Tested-by: Jenkins Server <pfd-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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/initservice')
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.C | 24 | ||||
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.H | 19 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 30 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 10 |
4 files changed, 49 insertions, 34 deletions
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C index 8b718716e..33cc46419 100644 --- a/src/usr/initservice/baseinitsvc/initservice.C +++ b/src/usr/initservice/baseinitsvc/initservice.C @@ -626,6 +626,7 @@ InitService& InitService::getTheInstance( ) InitService::InitService( ) : iv_shutdownInProgress(false), + iv_stopIPL(false), iv_worst_status(false), iv_iStep( 0 ), iv_iSubStep( 0 ) @@ -718,6 +719,29 @@ bool InitService::_setShutdownStatus( return first; } +// External call to stop the IPL +void stopIpl() +{ + // Set the flag to disable istep dispatcher + Singleton<InitService>::instance().stopIpl(); +} + +void InitService::stopIpl() +{ + iv_stopIPL = true; +} + +// External call to grab the stopIpl status +bool isIplStopped() +{ + return Singleton<InitService>::instance().isIplStopped(); +} + +bool InitService::isIplStopped() +{ + return iv_stopIPL; +} + void doShutdown(uint64_t i_status, bool i_inBackground, uint64_t i_payload_base, diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H index 356b4b8f8..43f5d9b2e 100644 --- a/src/usr/initservice/baseinitsvc/initservice.H +++ b/src/usr/initservice/baseinitsvc/initservice.H @@ -252,6 +252,23 @@ public: uint64_t i_masterHBInstance = THIS_NODE_NO_PAYLOAD, uint32_t i_error_info = 0); + /** + * @brief Set flag to stop the execution of IPL isteps + * + * @note: See the API documentation @ + * src/include/usr/initservice/initserviceif.H + */ + void stopIpl(); + + /** + * @brief Check if the execution of isteps should stop + * @return true = IPL's istep execution is stopped + * + * @note: See the API documentation @ + * src/include/usr/initservice/initserviceif.H + */ + bool isIplStopped(); + protected: /** @@ -323,6 +340,7 @@ private: uint64_t i_masterHBInstance = 0xffffffffffffffffull, uint32_t i_error_info = 0); + /** * Check and load module associated with this task or function * if necessary. @@ -367,6 +385,7 @@ private: mutex_t iv_registryMutex; bool iv_shutdownInProgress; + bool iv_stopIPL; // flag states if istep execution is stopped // Worst shutdown status accumulated during shutdown processing uint64_t iv_worst_status; diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index a1d00a10f..532199d3a 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -139,7 +139,6 @@ IStepDispatcher::IStepDispatcher() : iv_substepToCompleteBeforeShutdown(0), iv_acceptIstepMessages(true), iv_newGardRecord(false), - iv_stopIpl(false), iv_p9_phbPerstLibLoaded(false) { @@ -497,7 +496,7 @@ errlHndl_t IStepDispatcher::executeAllISteps() substep = 0; while (substep < g_isteps[istep].numitems) { - if( iv_stopIpl == true ) + if( INITSERVICE::isIplStopped() == true ) { #ifdef CONFIG_BMC_IPMI // if we came in here and we are connected to a BMC, then @@ -761,7 +760,7 @@ errlHndl_t IStepDispatcher::executeAllISteps() ERRORLOG::ErrlManager::callFlushErrorLogs(); // Quiesce new isteps, including external requests - (void)setStopIpl(); + INITSERVICE::stopIpl(); #ifdef CONFIG_HANG_ON_MFG_SRC_TERM // Stop the IPL @@ -1787,7 +1786,7 @@ void IStepDispatcher::handleShutdownMsg(msg_t * & io_pMsg) void IStepDispatcher::requestReboot() { // Always stop dispatching isteps before calling for the reboot - (void)setStopIpl(); + INITSERVICE::stopIpl(); // Send a reboot message to the BMC (void)IPMI::initiateReboot(); @@ -1796,7 +1795,7 @@ void IStepDispatcher::requestReboot() void IStepDispatcher::requestPowerOff() { // Always stop dispatching isteps before calling for the power off - (void)setStopIpl(); + INITSERVICE::stopIpl(); // Send a power off message to the BMC (void)IPMI::initiatePowerOff(); @@ -1855,20 +1854,7 @@ 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() @@ -2035,7 +2021,7 @@ void IStepDispatcher::handleIStepRequestMsg(msg_t * & io_pMsg) mutex_unlock(&iv_mutex); // If istep dispatching has ceased, prevent new isteps from executing - if(iv_stopIpl == true) + if(INITSERVICE::isIplStopped() == true) { /*@ * @errortype @@ -2718,11 +2704,7 @@ void requestPowerOff() IStepDispatcher::getTheInstance().requestPowerOff(); } #endif -void stopIpl() -{ - // Disable the istep dispatcher - return IStepDispatcher::getTheInstance().setStopIpl(); -} + // ---------------------------------------------------------------------------- // IStepDispatcher::getIstepInfo() diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index bf8950c75..558fc95d1 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -214,12 +214,6 @@ 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 */ @@ -492,10 +486,6 @@ 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; - // Instance variable to state if the PHB Perst libraries are loaded bool iv_p9_phbPerstLibLoaded; |