summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/istepdispatcher
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2012-11-27 13:59:43 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-08 10:37:00 -0600
commite25073a5222d236cc8bec3bb111ec3d7ab7a1575 (patch)
treecfc6ebf3237b16ffc2fc52c5b16f3c51f1f0b149 /src/usr/initservice/istepdispatcher
parent74c20caefdab7f7aa9268dd3f359f2038cee8ccf (diff)
downloadtalos-hostboot-e25073a5222d236cc8bec3bb111ec3d7ab7a1575.tar.gz
talos-hostboot-e25073a5222d236cc8bec3bb111ec3d7ab7a1575.zip
Sync attributes from hostboot to fsp after each istep
Code will sync targeting attributes in single step mode if the ATTR_SYNC_BETWEEN_STEPS is overriden in FspOverideAttrs.txt in the FSP nfs/hwpf dir Change-Id: Ifd7603bb7ce75a9ae7b5df5ac1c605916ba63aab RTC: 46672 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2978 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/istepdispatcher')
-rw-r--r--src/usr/initservice/istepdispatcher/istepWorker.C103
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C15
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.H19
3 files changed, 102 insertions, 35 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepWorker.C b/src/usr/initservice/istepdispatcher/istepWorker.C
index b42fa1949..0a42be139 100644
--- a/src/usr/initservice/istepdispatcher/istepWorker.C
+++ b/src/usr/initservice/istepdispatcher/istepWorker.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/initservice/istepdispatcher/istepWorker.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/initservice/istepdispatcher/istepWorker.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file istepWorker.C
*
@@ -47,6 +46,12 @@
//#include <initservice/initsvcudistep.H> // InitSvcUserDetailsIstep
+#include <targeting/attrsync.H>
+
+#include <targeting/common/attributes.H>
+
+#include <fapiAttributeService.H>
+
#include "istep_mbox_msgs.H"
#include "istepWorker.H"
#include "istepdispatcher.H"
@@ -59,6 +64,7 @@ namespace INITSERVICE
/******************************************************************************/
extern trace_desc_t *g_trac_initsvc;
+bool getSyncEnabledAttribute();
// ----------------------------------------------------------------------------
// startIStepWorkerThread
@@ -93,11 +99,14 @@ void iStepWorkerThread ( void * i_msgQ )
uint32_t istep = 0x0;
uint32_t substep = 0x0;
uint64_t progressCode = 0x0;
- bool first = true;
+ bool first = true;
TRACDCOMP( g_trac_initsvc,
ENTER_MRK"iStepWorkerThread()" );
+ // cache the value, it wont change during ipl.
+ bool step_mode = IStepDispatcher::getTheInstance().getIStepMode();
+
while( 1 )
{
// Send More Work Needed msg to the main thread.
@@ -152,13 +161,35 @@ void iStepWorkerThread ( void * i_msgQ )
if( NULL != theStep )
{
TRACFCOMP( g_trac_initsvc,
- "IStepDispatcher (worker): Run Istep (%d), substep(%d), "
- "- %s",
+ "IStepDispatcher (worker): Run Istep (%d), substep(%d), "
+ "- %s",
istep, substep, theStep->taskname );
err = InitService::getTheInstance().executeFn( theStep,
NULL );
+ // sync the attributes to fsp in single step mode but only
+ // after step 6 is complete to allow discoverTargets() to
+ // run before the sync is done.
+ if( step_mode && istep > 6 )
+ {
+ // this value can change between steps, so read now
+ if( getSyncEnabledAttribute() )
+ {
+ TRACFCOMP( g_trac_initsvc, "sync attributes to FSP");
+
+ errlHndl_t l_errl = TARGETING::syncAllAttributesToFsp();
+
+ if(l_errl)
+ {
+ TRACFCOMP(g_trac_initsvc, "Attribute sync between steps failed, see"
+ "%x for details", l_errl->eid());
+
+ errlCommit(l_errl, INITSVC_COMP_ID);
+ }
+ }
+ }
+
if( err )
{
TRACFCOMP( g_trac_initsvc,
@@ -217,6 +248,8 @@ void iStepWorkerThread ( void * i_msgQ )
#endif
}
+
+
// flush contTrace after each istep/substep returns
TRAC_FLUSH_BUFFERS();
@@ -332,5 +365,23 @@ const TaskInfo * findTaskInfo( const uint32_t i_IStep,
return l_pistep;
}
+// $TODO - temporary implementation for bringup
+bool getSyncEnabledAttribute()
+{
+ uint8_t l_syncEnabled = 0;
+
+ // $TODO RTC Issue 64008 - update to use targeting attribute accessors
+ fapi::ReturnCode l_rc;
+ l_rc = FAPI_ATTR_GET(ATTR_SYNC_BETWEEN_STEPS, NULL, l_syncEnabled);
+ if (l_rc)
+ {
+ // trace for now, elog with new implementation
+ TRACFCOMP(g_trac_initsvc,"failed to read ATTR_SYNC_BETWEEN_STEPS, default"
+ " to no sync");
+
+ }
+
+ return ( (l_syncEnabled) ? true : false );
+}
} // namespace
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 7d8febd9a..3ee4818b6 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -51,6 +51,7 @@
#include <targeting/common/attributes.H> // ISTEP_MODE attribute
#include <targeting/common/targetservice.H>
+#include <targeting/attrsync.H>
#include <hwpf/plat/fapiPlatAttributeService.H>
@@ -213,8 +214,22 @@ void IStepDispatcher::init ( errlHndl_t &io_rtaskRetErrl )
// Execute all Isteps sequentially in 'normal' mode
err = executeAllISteps();
+
if( err )
{
+ // per interlock meeting, adding sync after ipl failure in
+ // normal IPL mode
+ TRACFCOMP( g_trac_initsvc, "sync attributes to FSP");
+
+ errlHndl_t l_errl = TARGETING::syncAllAttributesToFsp();
+
+ if(l_errl)
+ {
+ TRACFCOMP(g_trac_initsvc, "Attribute sync failed, see"
+ "%x for details", l_errl->eid());
+ errlCommit(l_errl, INITSVC_COMP_ID);
+ }
+
break;
}
}
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H
index 91d5c1503..152935521 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.H
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -181,6 +181,15 @@ public:
*/
bool isMpiplMode( void ) const;
+ /**
+ * @brief getIStepMode - return value of IStep Mode
+ *
+ * @return bool - value of iv_istepmodeflag
+ * @retval false if IStep Mode is "OFF"
+ * true if IStep Mode is "ON"
+ */
+ bool getIStepMode( ) const;
+
protected:
/**
@@ -202,14 +211,6 @@ private:
IStepDispatcher(const IStepDispatcher& i_right);
IStepDispatcher& operator=(const IStepDispatcher& i_right);
- /**
- * @brief getIStepMode - return value of IStep Mode
- *
- * @return bool - value of iv_istepmodeflag
- * @retval false if IStep Mode is "OFF"
- * true if IStep Mode is "ON"
- */
- bool getIStepMode( ) const;
/**
* @brief This function will start at istep 0, substep 0, and cycle
OpenPOWER on IntegriCloud