summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-11-07 15:18:38 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-01-10 13:53:48 -0600
commit7617b1930b50fca7692d971addf0e55243afe833 (patch)
tree3829bca9b1f512661f78a1b176b824482d789b11 /src/usr/initservice
parent908baf329747b078d6604741cd4734300a70bacb (diff)
downloadblackbird-hostboot-7617b1930b50fca7692d971addf0e55243afe833.tar.gz
blackbird-hostboot-7617b1930b50fca7692d971addf0e55243afe833.zip
istep 18.9 - sys_proc_fab_iovalid
. istepdispatcher code will create separate thread to do the work, when the message is received from FSP . call p8_block_wakeup_intr(SET) on all EX chiplets . call cpu_all_winkle() when finished Change-Id: Id594bd9c48b490838e92c4d63ecc4bcd293f9f53 RTC: 72052 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7403 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/initservice')
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C106
-rw-r--r--src/usr/initservice/istepdispatcher/sptask.C50
2 files changed, 113 insertions, 43 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index e76fdc331..cf0718126 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -38,6 +38,7 @@
#include <kernel/console.H> // printk status
#include <vfs/vfs.H> // for VFS::module_load
#include <sys/task.h> // tid_t, task_create, etc
+#include <sys/misc.h> // cpu_all_winkle
#include <errl/errlentry.H> // errlHndl_t
#include <initservice/isteps_trace.H> // ISTEPS_TRACE buffer
#include <initservice/initsvcudistep.H> // InitSvcUserDetailsIstep
@@ -1188,30 +1189,99 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg)
{
TRACFCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::handleProcFabIovalidMsg");
- // Ensure the library is loaded
- errlHndl_t err = VFS::module_load("libestablish_system_smp.so");
-
- if (err)
- {
- TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading module, PLID = 0x%x",
- err->plid());
- errlCommit(err, INITSVC_COMP_ID);
- msg_free(io_pMsg);
- io_pMsg = NULL;
- }
- else
+ errlHndl_t err = NULL;
+ do
{
- // $TODO RTC:88284 - Create Child Thread
- ESTABLISH_SYSTEM_SMP::host_sys_fab_iovalid_processing(io_pMsg);
+ // Ensure the libraries needed are loaded
+ err = VFS::module_load("libestablish_system_smp.so");
+ if (err)
+ {
+ TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading libestablish_system_smp, PLID = 0x%x",
+ err->plid());
+
+ io_pMsg->data[0] = err->plid();
+ errlCommit(err, INITSVC_COMP_ID);
+ break;
+ }
+ err = VFS::module_load("libedi_ei_initialization.so");
+ if (err)
+ {
+ TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading libedi_ei_initialization, PLID = 0x%x",
+ err->plid());
- // if there was an error don't winkle ?
+ io_pMsg->data[0] = err->plid();
+ errlCommit(err, INITSVC_COMP_ID);
+ break;
+ }
+
+ // Create child thread so that if there are problems, the istep
+ // dispatcher code continues
+ tid_t l_progTid = task_create(
+ ESTABLISH_SYSTEM_SMP::host_sys_fab_iovalid_processing,io_pMsg);
+ assert( l_progTid > 0 );
+ // wait here for the task to end.
+ // status of the task ( OK or Crashed ) is returned in l_childsts
+ int l_childsts = 0;
+ void *l_childrc = NULL;
+ tid_t l_tidretrc = task_wait_tid( l_progTid,
+ &l_childsts, &l_childrc );
+ if ((static_cast<int16_t>(l_tidretrc) < 0 ) ||
+ (l_childsts != TASK_STATUS_EXITED_CLEAN )
+ )
+ {
+ TRACFCOMP(g_trac_initsvc, "task_wait_tid failed; l_tidretrc=0x%x, l_childsts=0x%x",
+ l_tidretrc, l_childsts);
+ // the launched task failed or crashed,
+ } // endif tidretrc
+
+ // if there wasn't an error, winkle
if(io_pMsg->data[0] == HWSVR_MSG_SUCCESS)
{
- TRACFCOMP( g_trac_initsvc,
- "$TODO RTC:71447 - winkle all cores");
+ // Send the message back as a response
+ free(io_pMsg->extra_data);
+ io_pMsg->extra_data = NULL;
+ msg_respond(iv_msgQ, io_pMsg);
+ io_pMsg = NULL;
+
+ // call to suspend the MBOX so that all messages are flushed
+ err = MBOX::suspend();
+ if (err)
+ {
+ TRACFCOMP( g_trac_initsvc, "ERROR : MBOX::suspend");
+ errlCommit(err, INITSVC_COMP_ID);
+ // keep going, since we already responded back to the FSP
+ }
+
+ TRACFCOMP( g_trac_initsvc, "winkle all cores");
+ uint32_t l_rc = cpu_all_winkle();
+ if ( l_rc )
+ {
+ // failed to winkle
+ TRACFCOMP( g_trac_initsvc,
+ "ERROR : failed cpu_all_winkle, rc=0x%x", l_rc );
+ }
+ else
+ {
+ // something woke us up, we'll return and see what msg is there
+ TRACFCOMP( g_trac_initsvc,
+ "Returned from cpu_all_winkle." );
+ }
+
+ err = MBOX::resume();
+ if (err)
+ {
+ TRACFCOMP( g_trac_initsvc, "ERROR : MBOX::resume");
+ errlCommit(err, INITSVC_COMP_ID);
+ }
}
+ } while (0);
+ // if there was an error send back that msg
+ if(io_pMsg && (io_pMsg->data[0] != HWSVR_MSG_SUCCESS))
+ {
// Send the message back as a response
+ free(io_pMsg->extra_data);
+ io_pMsg->extra_data = NULL;
msg_respond(iv_msgQ, io_pMsg);
io_pMsg = NULL;
}
@@ -1220,7 +1290,7 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg)
}
// ----------------------------------------------------------------------------
-// IStepDispatcher::handleProcFabIovalidMsg()
+// IStepDispatcher::sendProgressCode()
// This method has a default of true for i_needsLock
// ----------------------------------------------------------------------------
errlHndl_t IStepDispatcher::sendProgressCode(bool i_needsLock)
diff --git a/src/usr/initservice/istepdispatcher/sptask.C b/src/usr/initservice/istepdispatcher/sptask.C
index c07f0d87e..ccbf280e0 100644
--- a/src/usr/initservice/istepdispatcher/sptask.C
+++ b/src/usr/initservice/istepdispatcher/sptask.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/initservice/istepdispatcher/sptask.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/sptask.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* */
+/* 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 sptask.C
*
@@ -159,8 +158,9 @@ void userConsoleComm( void * io_msgQ )
writeSts( l_sts );
// pass the command on to IstepDisp, block until reply
- l_pCurrentMsg->type = 0x0;
- l_pCurrentMsg->data[0] =
+
+ l_pCurrentMsg->type = ISTEP_MSG_TYPE;
+ l_pCurrentMsg->data[0] =
( ( static_cast<uint64_t>(l_cmd.istep & 0xFF) << 32) |
( static_cast<uint64_t>(l_cmd.substep & 0xFF ) ) );
l_pCurrentMsg->data[1] = 0;
OpenPOWER on IntegriCloud