From d9e7745912867407eba0d844b3d37a9bbcce355b Mon Sep 17 00:00:00 2001 From: Dean Sanner Date: Mon, 23 Jan 2017 14:19:10 -0600 Subject: [PATCH] Fix algorithm to deconfig non paired cores in fused mode for BU -Deconfig dangling single cores for lab HW -Product HW won't have this issue Change-Id: Ide7b342f3cd2aff2e78fd39006698f0077828e68 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35274 Reviewed-by: Martin Gloff Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/usr/hwas/common/hwas.C | 57 ++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index c9955b5fd91..17887430094 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -1032,7 +1032,44 @@ bool isDescFunctional(const TARGETING::TargetHandle_t &i_desc, return l_descFunctional; } // isDescFunctional +void forceEcExEqDeconfig(const TARGETING::TargetHandle_t i_core, + const bool i_present, + const uint32_t i_deconfigReason) +{ + TargetHandleList pECList; + TargetHandleList pEXList; + + //Deconfig the EC + enableHwasState(i_core, i_present, false, i_deconfigReason); + HWAS_INF("pEC %.8X - marked %spresent, NOT functional", + i_core->getAttr(), i_present ? "" : "NOT "); + + //Get parent EX and see if any other cores, if none, deconfig + auto exType = TARGETING::TYPE_EX; + auto eqType = TARGETING::TYPE_EQ; + + TARGETING::Target* l_ex = const_cast( + getParent(i_core, exType)); + getChildChiplets(pECList, l_ex, TYPE_CORE, true); + if(pECList.size() == 0) + { + enableHwasState(l_ex, i_present, false, i_deconfigReason); + HWAS_INF("pEX %.8X - marked %spresent, NOT functional", + l_ex->getAttr(), i_present ? "" : "NOT "); + + //Now get the parent EQ and check to see if it should be deconfigured + TARGETING::Target* l_eq = const_cast( + getParent(l_ex, eqType)); + getChildChiplets(pEXList, l_eq, TYPE_EX, true); + if(pEXList.size() == 0) + { + enableHwasState(l_eq, i_present, false, i_deconfigReason); + HWAS_INF("pEQ %.8X - marked %spresent, NOT functional", + l_eq->getAttr(), i_present ? "" : "NOT "); + } + } +} errlHndl_t restrictECunits( std::vector &i_procList, @@ -1093,8 +1130,9 @@ errlHndl_t restrictECunits( break; } - // get this proc's (CHILD) functional EX units - getChildChiplets(pEXList[i], pProc, TYPE_EX, true); + // get this proc's (CHILD) EX units + // Need to get all so we init the pEC_it array + getChildChiplets(pEXList[i], pProc, TYPE_EX, false); if (!pEXList[i].empty()) { @@ -1116,6 +1154,9 @@ errlHndl_t restrictECunits( getChildChiplets(pECList[i][j], pEX, TYPE_CORE, true); + // keep a pointer into that list + pEC_it[i][j] = pECList[i][j].begin(); + if (!pECList[i][j].empty()) { // sort the list by ATTR_HUID to ensure that we @@ -1123,9 +1164,6 @@ errlHndl_t restrictECunits( std::sort(pECList[i][j].begin(), pECList[i][j].end(), compareTargetHuid); - // keep a pointer into that list - pEC_it[i][j] = pECList[i][j].begin(); - // keep local count of current functional EC units if (pECList[i][j].size() == 2) { @@ -1161,7 +1199,7 @@ errlHndl_t restrictECunits( if( is_fused_mode() ) { // only allow complete pairs - maxECs = std::min( currentPairedECs*2, maxECs ); + maxECs = std::min( currentPairedECs, maxECs ); } if ((currentPairedECs + currentSingleECs) <= maxECs) @@ -1231,12 +1269,7 @@ errlHndl_t restrictECunits( { // got an EC to be restricted and marked not functional TargetHandle_t l_pEC = *(pEC_it[i][j]); - enableHwasState(l_pEC, i_present, - false, i_deconfigReason); - HWAS_INF("pEC %.8X - marked %spresent," - " NOT functional", - l_pEC->getAttr(), - i_present ? "" : "NOT "); + forceEcExEqDeconfig(l_pEC, i_present, i_deconfigReason); } (pEC_it[i][j])++; // next ec in this ex's list