diff options
author | Andrew Jeffery <andrewrj@au1.ibm.com> | 2018-10-05 12:59:29 +0930 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-10-10 13:38:21 -0500 |
commit | 1b481183921d9877a5693219249bb9c4cd8ccf69 (patch) | |
tree | 85b5197eeece8bbb7b75a55c476f76bdf63e8e17 /src/usr/ipmi/ipmirp.C | |
parent | e9ade5b4dbf715290726d24631e445ffd929c749 (diff) | |
download | talos-hostboot-1b481183921d9877a5693219249bb9c4cd8ccf69.tar.gz talos-hostboot-1b481183921d9877a5693219249bb9c4cd8ccf69.zip |
ipmi: IpmiDD and IpmiRP must never free resources
An IPMI-based PNOR implementation will be introduced in the future. If
it is in use (and it likely will be), then IpmiDD and IpmiRP must be
functional right up until the shutdown() syscall is invoked. This is
necessary because hostboot assumes parts of the PNOR can be paged in at
any time (though not necessarily dirtied and flushed), and IPMI is now
required to fulfil the requests.
Remove the unnecessary shutdown-related code from both classes.
Change-Id: I82276e5e12c8b917d655000a456b72a2ccacdb5f
Signed-off-by: Andrew Jeffery <andrewrj@au1.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67077
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmirp.C')
-rw-r--r-- | src/usr/ipmi/ipmirp.C | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C index c183d01e1..8afff0136 100644 --- a/src/usr/ipmi/ipmirp.C +++ b/src/usr/ipmi/ipmirp.C @@ -78,7 +78,6 @@ IpmiRP::IpmiRP(void): iv_recv_buffer_size(IPMI::g_recv_buffer_size), iv_retries(IPMI::g_retries), iv_shutdown_msg(NULL), - iv_shutdown_now(false), iv_graceful_shutdown_pending(false), iv_chassis_power_mod(IPMI::CHASSIS_POWER_OFF) { @@ -180,17 +179,11 @@ void IpmiRP::timeoutThread(void) while (true) { mutex_lock(&iv_mutex); - while ((iv_timeoutq.size() == 0) && !iv_shutdown_now) + while ((iv_timeoutq.size() == 0)) { sync_cond_wait(&iv_cv, &iv_mutex); } - // shutting down... - if (iv_shutdown_now) - { - break; // return and terminate thread - } - msg_t*& msq_msg = iv_timeoutq.front(); IPMI::Message* msg = static_cast<IPMI::Message*>(msq_msg->extra_data); @@ -554,7 +547,8 @@ void IpmiRP::attach(void) msg_q_t mq = Singleton<IpmiDD>::instance().eventQueue(); - while (!iv_shutdown_now) + /* FIXME: Never shut down */ + while (1) { /* Forward it into the internal message queue */ msg_send(iv_msgQ, msg_wait(mq)); @@ -741,24 +735,15 @@ void IpmiRP::execute(void) } // Once quiesced, reply to shutdown msg and exit. - // For IPMI based systems if we received the soft power off (graceful - // shutdown) request then we have more processing to do, so respond - // to the first shutdown message and instead of exiting we go back - // and wait for the post memory flush shutdown message then send a - // power off command to the BMC + // Shutdown simply puts us in a state we deny all further requests bar + // those from PnorIpmiDD. Access to the PNOR must be provided right up + // until we call the shutdown syscall, so there's no point at which we + // can deallocate the resources consumed by IpmiRP, IpmiDD or + // PnorIpmiDD. if (l_shutdown_pending && iv_respondq.empty() && iv_sendq.empty()) { - if(iv_graceful_shutdown_pending) - { - - IPMI_TRAC(INFO_MRK "reply to the MSG_STATE_SHUTDOWN message"); - msg_respond(iv_msgQ, iv_shutdown_msg); - } - else - { - shutdownNow(); - break; // exit loop and terminate task - } + IPMI_TRAC(INFO_MRK "reply to the MSG_STATE_SHUTDOWN message"); + msg_respond(iv_msgQ, iv_shutdown_msg); } } @@ -946,32 +931,6 @@ void IpmiRP::queueForResponse(IPMI::Message& i_msg) return; } -/// -/// @brief handle shutdown. -/// Queued messages to send have been sent and all responses complete. -/// Now that we are quiesced, deallocate resources and respond to the -/// shutdown message -/// -void IpmiRP::shutdownNow(void) -{ - IPMI_TRAC(INFO_MRK "IpmiRP::shutdownNow() "); - - mutex_lock(&iv_mutex); - iv_shutdown_now = true; // Shutdown underway - - // Wake up Time out thread to terminate. - sync_cond_signal(&iv_cv); - mutex_unlock(&iv_mutex); - - // TODO: RTC 116600 unRegisterMsgQ for interrupts - - // Shut down device driver - Singleton<IpmiDD>::instance().handleShutdown(); - - // reply back to shutdown requester that we are shutdown - msg_respond(iv_msgQ, iv_shutdown_msg); -} - namespace IPMI { /// |