summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi/ipmidd.C
diff options
context:
space:
mode:
authorAndrew Jeffery <andrewrj@au1.ibm.com>2018-09-17 17:23:09 +0930
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-10-08 15:24:20 -0500
commitbc363055ec19613cc2e2fb40392765e03f401c1a (patch)
tree046546dbcd0b96466f5217db9e7bdda21a2a0e07 /src/usr/ipmi/ipmidd.C
parente862c4c5a9e0385fac01827f2d7d4c6cc402caf3 (diff)
downloadblackbird-hostboot-bc363055ec19613cc2e2fb40392765e03f401c1a.tar.gz
blackbird-hostboot-bc363055ec19613cc2e2fb40392765e03f401c1a.zip
ipmi: Break circular dependency between IpmiDD and IpmiRP
Previously IpmiDD depended on IpmiRP to acquire IpmiRP's message queue for IpmiDD to enqueue hardware state change events. IpmiRP in-turn depends on IpmiDD for shutdown event handling, calling through IpmiDD::handleShutdown() in IpmiRP::shutdownNow(). Break the circular dependency by asynchronously publishing hardware state change events from IpmiDD on a queue owned by IpmiDD. IpmiRP consumes messages from IpmiDD's event queue and republishes them on its own internal queue for consumption by the state management task. This is a little inefficient but provides for greater design clarity in the face of a lack of a select() or poll() style interface that would allow listening for messages on multiple message queues. Change-Id: I3c3c3209d515ec9e90c04630779624bf85e953b1 Signed-off-by: Andrew Jeffery <andrewrj@au1.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65936 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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmidd.C')
-rw-r--r--src/usr/ipmi/ipmidd.C13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/usr/ipmi/ipmidd.C b/src/usr/ipmi/ipmidd.C
index 35f1d53f5..da3130cbf 100644
--- a/src/usr/ipmi/ipmidd.C
+++ b/src/usr/ipmi/ipmidd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,6 @@
#include <errl/errludlogregister.H>
#include <errl/errludstring.H>
#include "ipmidd.H"
-#include "ipmirp.H"
#include <ipmi/ipmiif.H>
#include <initservice/initserviceif.H>
#include <util/align.H>
@@ -189,7 +188,6 @@ void IpmiDD::pollCtrl(void)
// We send a message to this message queue when the ipmi state changes.
// Don't free these messages - these messages are sent async so the
// consumer will free the message.
- static msg_q_t mq = Singleton<IpmiRP>::instance().msgQueue();
msg_t* msg = NULL;
uint8_t ctrl = 0;
@@ -221,7 +219,7 @@ void IpmiDD::pollCtrl(void)
{
msg = msg_allocate();
msg->type = IPMI::MSG_STATE_IDLE;
- msg_send(mq, msg);
+ msg_send(iv_eventQ, msg);
iv_eagains = false;
}
// Check on shutdown if idle
@@ -236,7 +234,7 @@ void IpmiDD::pollCtrl(void)
{
msg = msg_allocate();
msg->type = IPMI::MSG_STATE_RESP;
- msg_send(mq, msg);
+ msg_send(iv_eventQ, msg);
}
// If we see the SMS_ATN, there's an event waiting
@@ -245,7 +243,7 @@ void IpmiDD::pollCtrl(void)
IPMI_TRAC(INFO_MRK "sending state sms/event");
msg = msg_allocate();
msg->type = IPMI::MSG_STATE_EVNT;
- msg_send(mq, msg);
+ msg_send(iv_eventQ, msg);
// Clear the SMS bit.
errlHndl_t err = writeLPC(REG_CONTROL, CTRL_SMS_ATN);
@@ -447,7 +445,8 @@ void IpmiDD::handleShutdown(void)
*/
IpmiDD::IpmiDD(void):
iv_shutdown_now(false),
- iv_eagains(false)
+ iv_eagains(false),
+ iv_eventQ(msg_q_create())
{
mutex_init(&iv_mutex);
OpenPOWER on IntegriCloud