From d73b8bc3e960795825e7ada1ec2700800fee1fba Mon Sep 17 00:00:00 2001 From: spashabk-in Date: Tue, 8 May 2018 12:16:05 -0500 Subject: Handle FSP failover RTC: 184532 Change-Id: If55aa9f13c648178c1f054d7c9728fe888c0ed63 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58498 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: RAJA DAS Reviewed-by: Sachin Gupta --- src/sbefw/app/power/sbecmdmpipl.C | 12 +++++++++--- src/sbefw/core/sberegaccess.C | 4 ++-- src/sbefw/core/sberegaccess.H | 6 +++++- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src/sbefw') diff --git a/src/sbefw/app/power/sbecmdmpipl.C b/src/sbefw/app/power/sbecmdmpipl.C index b12453eb..2951852f 100644 --- a/src/sbefw/app/power/sbecmdmpipl.C +++ b/src/sbefw/app/power/sbecmdmpipl.C @@ -230,15 +230,21 @@ uint32_t sbeContinueMpipl(uint8_t *i_pArg) rc = sbeUpFifoDeq_mult (len, NULL); CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc); - sbeRole sbeRole = SbeRegAccess::theSbeRegAccess().isSbeSlave() ? + // Refresh SBE role and proc chip mem attribute + // to handle failover of FSP and with it the switchover of + // master proc SBE + fapi2::plat_AttrInit(); + SbeRegAccess::theSbeRegAccess().init(true); + + g_sbeRole = SbeRegAccess::theSbeRegAccess().isSbeSlave() ? SBE_ROLE_SLAVE : SBE_ROLE_MASTER; - fapiRc = continueMpiplIstepsExecute(sbeRole); + fapiRc = continueMpiplIstepsExecute(g_sbeRole); bool checkstop = isSystemCheckstop(); if((fapiRc != FAPI2_RC_SUCCESS) || checkstop) { SBE_ERROR(SBE_FUNC "Failed in Continue Mpipl in ChipOp Mode, " - "SBE Role[%d]", sbeRole); + "SBE Role[%d]", g_sbeRole); if(checkstop) { respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE, diff --git a/src/sbefw/core/sberegaccess.C b/src/sbefw/core/sberegaccess.C index 1ac5deac..1fc415bc 100644 --- a/src/sbefw/core/sberegaccess.C +++ b/src/sbefw/core/sberegaccess.C @@ -131,7 +131,7 @@ void SbeRegAccess::stateTransition(const sbeEvent &i_event) #undef SBE_FUNC } -uint32_t SbeRegAccess::init() +uint32_t SbeRegAccess::init(bool forced) { #define SBE_FUNC "SbeRegAccess::SbeRegAccess " static bool l_initDone = false; @@ -139,7 +139,7 @@ uint32_t SbeRegAccess::init() do { - if(l_initDone) + if(l_initDone && !forced) { break; } diff --git a/src/sbefw/core/sberegaccess.H b/src/sbefw/core/sberegaccess.H index 62d07d41..b2d7e1d7 100644 --- a/src/sbefw/core/sberegaccess.H +++ b/src/sbefw/core/sberegaccess.H @@ -64,10 +64,14 @@ class SbeRegAccess /** * @brief Initializes the class for use * + * @param [in] forced Forcefully initialise reg access + * singleton. + * Default argument set to false. + * * @return An RC indicating success/failure * */ - uint32_t init(); + uint32_t init(bool forced=false); /** * @brief Update the SBE states into the SBE messaging register. The -- cgit v1.2.1