Skip to content

Commit

Permalink
Check for pending OCC messages on HBRT start in OpenPOWER
Browse files Browse the repository at this point in the history
The OCC will set an interrupt for the Host to look for a pending
message/action.  If opal-prd is not running at the time that this
interrupt happens, HTMGT will never see the message.  Therefore
we need to have HTMGT explicitly check for anything pending any
time HBRT starts up.

Change-Id: Iaae075ae6828a9de5a7bd5afe55c541b0076f2d2
RTC: 187912
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57356
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
brianebakke authored and dcrowell77 committed Apr 21, 2018
1 parent 6d48b4d commit 4366e14
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/include/runtime/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,12 @@ struct postInitCalls_t
*/
void (*callClearPendingSbeMsgs)();

/**
* @brief Clear pending OCC messages
*
*/
void (*callClearPendingOccMsgs)();

};

extern hostInterfaces_t* g_hostInterfaces;
Expand Down
11 changes: 11 additions & 0 deletions src/runtime/rt_main.C
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ runtimeInterfaces_t* rt_start(hostInterfaces_t* intf)
// check for possible missed in-flight messages/interrupts
rtPost->callClearPendingSbeMsgs();

// check for possible missed in-flight messages/interrupts
if (rtPost->callClearPendingOccMsgs != nullptr )
{
// vector ptr has been initted, use it
rtPost->callClearPendingOccMsgs();
}
else
{
// (HTMGT not compiled in by default)
}

// do any version mismatch fixups
rt_version_fixup();

Expand Down
36 changes: 34 additions & 2 deletions src/usr/htmgt/runtime/rt_occ.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -158,5 +158,37 @@ namespace HTMGT
};

registerOcc g_registerOcc;
}


//------------------------------------------------------------------------

void process_occ_clr_msgs( void )
{
#ifdef CONFIG_HTMGT
// a NULL parameter will cause processOccError() to poll
// all of the OCCs (since the parm was invalid)
TARGETING::Target * l_DummyOccTarget = nullptr;
HTMGT::processOccError(l_DummyOccTarget);
#else
TMGT_ERR("Unexpected call to process_occ_clr_msgs"
" when HTMGT is not enabled");
#endif
}


//------------------------------------------------------------------------

struct registerOccStartup
{
registerOccStartup()
{
// Register interface for Host to call
postInitCalls_t * rt_post = getPostInitCalls();
rt_post->callClearPendingOccMsgs = &process_occ_clr_msgs;
}

};

registerOccStartup g_registerOccStartup;

} // end namespace HTMGT

0 comments on commit 4366e14

Please sign in to comment.