diff options
author | Matt Ploetz <maploetz@us.ibm.com> | 2016-04-12 11:31:23 -0500 |
---|---|---|
committer | Matthew A. Ploetz <maploetz@us.ibm.com> | 2016-05-11 12:12:30 -0400 |
commit | a2eeea7a4f8441d241251e1411735302144ca3bf (patch) | |
tree | 089bf223ec674cc03610917022360db99b181c68 /src/usr/initservice/istepdispatcher | |
parent | 1d150b6e4e679d4c1248e9e49c1d2ccec2483b63 (diff) | |
download | talos-hostboot-a2eeea7a4f8441d241251e1411735302144ca3bf.tar.gz talos-hostboot-a2eeea7a4f8441d241251e1411735302144ca3bf.zip |
Increment reboot count when gard records are written
Change-Id: Iaf9a4d4be19877e564ca1871564467441b472253
CQ:SW347568
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23186
Reviewed-by: A. P. Williams III <iawillia@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Tested-by: FSP CI Jenkins
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24340
Diffstat (limited to 'src/usr/initservice/istepdispatcher')
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 61 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 11 |
2 files changed, 70 insertions, 2 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index 88cafc7e7..cec5013ea 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -42,6 +42,7 @@ #include <sys/task.h> // tid_t, task_create, etc #include <sys/misc.h> // cpu_all_winkle #include <errl/errlentry.H> // errlHndl_t +#include <errl/errlmanager.H> #include <initservice/isteps_trace.H> // ISTEPS_TRACE buffer #include <initservice/initsvcudistep.H> // InitSvcUserDetailsIstep #include <initservice/taskargs.H> // TASK_ENTRY_MACRO @@ -120,7 +121,8 @@ IStepDispatcher::IStepDispatcher() : iv_futureShutdown(false), iv_istepToCompleteBeforeShutdown(0), iv_substepToCompleteBeforeShutdown(0), - iv_acceptIstepMessages(true) + iv_acceptIstepMessages(true), + iv_newGardRecord(false) { mutex_init(&iv_bkPtMutex); @@ -540,6 +542,39 @@ errlHndl_t IStepDispatcher::executeAllISteps() else { #ifdef CONFIG_BMC_IPMI + // Check the newGardRecord instance variable + if(iv_newGardRecord) + { + // We have a new gard record committed. We need + // to increment the reboot count + uint16_t l_count = 0; + SENSOR::RebootCountSensor l_sensor; + // Read reboot count sensor + err = l_sensor.getRebootCount(l_count); + if (err) + { + TRACFCOMP(g_trac_initsvc, ERR_MRK"executeAllISteps: getRebootCount failed"); + break; + } + // Increment reboot count + l_count++; + err = l_sensor.setRebootCount(l_count); + if (err) + { + TRACFCOMP(g_trac_initsvc, ERR_MRK"executeAllISteps: setRebootCount failed"); + break; + } + } + else + { + // We are in a reconfig loop, but no new gard + // records have been set. We will not increment + // the reboot count. + TRACFCOMP(g_trac_initsvc, "Reconfig loop needed " + "but no new gard records were commited. Do " + "not increment reboot count."); + } + // @TODO RTC:124679 - Remove Once BMC Monitors // Shutdown Attention // Set Watchdog Timer before calling doShutdown() @@ -782,6 +817,11 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep, { // There was no PLD, process any deferred deconfig records (i.e. // actually do the deconfigures) + // We need to flush the errl buffer first + ERRORLOG::ErrlManager::callFlushErrorLogs(); + + // Regardless of the way the flush came back, we need to try to + // process the deferred deconfigs HWAS::theDeconfigGard().processDeferredDeconfig(); } @@ -1407,6 +1447,20 @@ void IStepDispatcher::iStepBreakPoint(uint32_t i_info) TRACFCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::handleBreakpointMsg"); mutex_unlock(&iv_bkPtMutex); } +// ----------------------------------------------------------------------------- +// IStepDispatcher::setNewGardRecord() +// ----------------------------------------------------------------------------- +void IStepDispatcher::setNewGardRecord() +{ + TRACDCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::setNewGardRecord"); + + mutex_lock(&iv_mutex); + iv_newGardRecord = true; + mutex_unlock(&iv_mutex); + + TRACDCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::setNewGardRecord"); + return; +} // ---------------------------------------------------------------------------- // IStepDispatcher::isShutdownRequested() @@ -1982,6 +2036,11 @@ void setAcceptIstepMessages(bool i_accept) { return IStepDispatcher::getTheInstance().setAcceptIstepMessages(i_accept); } +void setNewGardRecord() +{ + return IStepDispatcher::getTheInstance().setNewGardRecord(); +} + // ---------------------------------------------------------------------------- // IStepDispatcher::getIstepInfo() // ---------------------------------------------------------------------------- diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index 5d941963c..186639fa6 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -197,6 +197,12 @@ public: void setAcceptIstepMessages(bool accept); + /** + * @brief This function will set a boolean true which states a new gard + * record has been written. + */ + void setNewGardRecord(); + protected: /** @@ -415,6 +421,9 @@ private: // accept istep messages or not bool iv_acceptIstepMessages; + // Instance variable to state if a new gard record was committed + bool iv_newGardRecord; + // Message Queue for receiving message from SP or SPless user console msg_q_t iv_msgQ; |