summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi/ipmirp.C
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2016-08-06 13:37:39 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-07 09:09:38 -0500
commit6e0b34872da165a1c30609d3e9d6cfbd70418507 (patch)
tree1da665e0024724133d96d665505d6dcc66026bc3 /src/usr/ipmi/ipmirp.C
parentf986133a26546254d64e65e30b00ae7f0d561ec9 (diff)
downloadtalos-hostboot-6e0b34872da165a1c30609d3e9d6cfbd70418507.tar.gz
talos-hostboot-6e0b34872da165a1c30609d3e9d6cfbd70418507.zip
OP820:OPRASGS:Garrison:Hostboot IPL fails to halt during shutdown reconfig
-Added the ability to notify the istep dispacher discontinue executing isteps -Added call to stopIpl() api in sbe update path -Added internal graceful reboot request for SBE update and reconfigure re-ipl usage Change-Id: I5682992802b0f373df91378a38187d032bb3a0b4 CQ:SW361886 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27959 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28574 Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmirp.C')
-rw-r--r--src/usr/ipmi/ipmirp.C47
1 files changed, 45 insertions, 2 deletions
diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C
index c7e702e0f..4c5db3f19 100644
--- a/src/usr/ipmi/ipmirp.C
+++ b/src/usr/ipmi/ipmirp.C
@@ -40,6 +40,7 @@
#include <sys/task.h>
#include <initservice/taskargs.H>
#include <initservice/initserviceif.H>
+#include <initservice/istepdispatcherif.H>
#include <sys/vfs.h>
#include <targeting/common/commontargeting.H>
@@ -459,6 +460,9 @@ void IpmiRP::handlePowerMessage( IPMI::oemSEL* i_event )
break;
}
+ // tell the istep dispacher to stop executing isteps
+ INITSERVICE::stopIpl();
+
// register for the post memory flush callback
INITSERVICE::registerShutdownEvent(iv_msgQ,
IPMI::MSG_STATE_GRACEFUL_SHUTDOWN,
@@ -470,6 +474,7 @@ void IpmiRP::handlePowerMessage( IPMI::oemSEL* i_event )
// initiate the shutdown processing in the background
INITSERVICE::doShutdown(SHUTDOWN_STATUS_GOOD,true);
+
} while (0);
}
@@ -563,6 +568,7 @@ void IpmiRP::execute(void)
while (true)
{
+
msg_t* msg = msg_wait(iv_msgQ);
const IPMI::msg_type msg_type =
@@ -682,15 +688,41 @@ void IpmiRP::execute(void)
iv_shutdown_msg = msg; // Reply to this message
-
#ifdef CONFIG_CONSOLE
- CONSOLE::displayf(NULL, "IPMI: shutdown complete");
+ CONSOLE::displayf(NULL, "IPMI: shutdown complete\n");
CONSOLE::flush();
#endif
}
break;
+ // begin a graceful reboot initated by us
+ case IPMI::MSG_STATE_INITATE_POWER_CYCLE:
+ {
+ msg_free(msg);
+
+#ifdef CONFIG_CONSOLE
+ CONSOLE::displayf(NULL, "IPMI: Initiate power cycle");
+ CONSOLE::flush();
+#endif
+ // setup the power cmd modifier to tell the bmc to
+ // do a power reset
+ iv_chassis_power_mod = IPMI::CHASSIS_POWER_RESET;
+
+ // register for the post memory flush callback
+ INITSERVICE::registerShutdownEvent(iv_msgQ,
+ IPMI::MSG_STATE_GRACEFUL_SHUTDOWN,
+ INITSERVICE::POST_MEM_FLUSH_NOTIFY_LAST);
+
+ iv_graceful_shutdown_pending = true;
+ lwsync();
+
+ // initiate the shutdown processing in the background
+ INITSERVICE::doShutdown(SHUTDOWN_STATUS_GOOD,true);
+
+ }
+ break;
+
};
// There's a good chance the interface will be idle right after
@@ -1047,6 +1079,17 @@ namespace IPMI
}
///
+ /// @brief kick off a reboot
+ ///
+ void initiateReboot()
+ {
+ static msg_q_t mq = Singleton<IpmiRP>::instance().msgQueue();
+ msg_t * msg = msg_allocate();
+ msg->type = IPMI::MSG_STATE_INITATE_POWER_CYCLE;
+ msg_send(mq, msg);
+ }
+
+ ///
/// @brief Maximum buffer for data (max xport - header)
///
size_t max_buffer(void)
OpenPOWER on IntegriCloud