summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwas/common/hwas.H7
-rw-r--r--src/usr/hwas/common/hwas.C49
2 files changed, 56 insertions, 0 deletions
diff --git a/src/include/usr/hwas/common/hwas.H b/src/include/usr/hwas/common/hwas.H
index 8dafb39ae..df6c3a004 100644
--- a/src/include/usr/hwas/common/hwas.H
+++ b/src/include/usr/hwas/common/hwas.H
@@ -186,6 +186,13 @@ void invokePresentByAssoc();
void presentByAssoc(TargetInfoVector& io_funcTargets,
TargetInfoVector& o_targToDeconfig);
+/**
+ * @brief Find the ATTR_EC for all processors and calculate the EFFECTIVE_EC
+ * (the lowest EC found)
+ *
+ */
+void calculateEffectiveEC();
+
}; // end namespace
#endif
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index dfe446576..4c26e9ea8 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -442,6 +442,10 @@ errlHndl_t discoverTargets()
}
}
+ //Now that all proc's are created and functional, we need to
+ //calculate the system EFFECTIVE_EC
+ calculateEffectiveEC();
+
// PR keyword processing - potentially reduce the number of ec/core
// units that are functional based on what's in the PR keyword.
// call to restrict EC units, marking bad units as present=false;
@@ -2181,4 +2185,49 @@ void presentByAssoc(TargetInfoVector& io_funcTargets,
} // while
} // presentByAssoc
+void calculateEffectiveEC()
+{
+ HWAS_INF("calculateEffectiveEC entry");
+
+ do
+ {
+ //true => FSP present. Only run this on non-FSP systems
+ TARGETING::Target * sys = NULL;
+ TARGETING::targetService().getTopLevelTarget( sys );
+ TARGETING::SpFunctions spfuncs;
+ if( sys &&
+ sys->tryGetAttr<TARGETING::ATTR_SP_FUNCTIONS>(spfuncs) &&
+ spfuncs.baseServices )
+ {
+ break;
+ }
+
+ //Get all functional chips
+ TARGETING::TargetHandleList l_procList;
+ getAllChips(l_procList, TYPE_PROC);
+
+ //Assume lowest EC among all functional processor chips is 0xFF
+ TARGETING::ATTR_EC_type l_lowestEC = 0xFF;
+
+ //Loop through all functional procs and find the lowest EC
+ for(TargetHandleList::const_iterator proc = l_procList.begin();
+ proc != l_procList.end(); ++proc)
+ {
+ if((*proc)->getAttr<TARGETING::ATTR_EC>() < l_lowestEC)
+ {
+ l_lowestEC = (*proc)->getAttr<TARGETING::ATTR_EC>();
+ }
+ }
+
+ HWAS_INF("Lowest functional proc chip EC = 0x%llx",l_lowestEC);
+
+ sys->setAttr<TARGETING::ATTR_EFFECTIVE_EC>(l_lowestEC);
+
+ }while(0);
+
+ HWAS_INF("calculateEffectiveEC exit");
+ return;
+
+} //calculateEffectiveEC
+
}; // end namespace
OpenPOWER on IntegriCloud