summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi/ipmidd.H
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.H
parente862c4c5a9e0385fac01827f2d7d4c6cc402caf3 (diff)
downloadtalos-hostboot-bc363055ec19613cc2e2fb40392765e03f401c1a.tar.gz
talos-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.H')
-rw-r--r--src/usr/ipmi/ipmidd.H21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/usr/ipmi/ipmidd.H b/src/usr/ipmi/ipmidd.H
index cb72d0076..ef6ed814f 100644
--- a/src/usr/ipmi/ipmidd.H
+++ b/src/usr/ipmi/ipmidd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -112,6 +112,15 @@ class IpmiDD
void handleShutdown(void);
/**
+ * @brief Get the queue on which IpmiDD publishes hardware events
+ *
+ * The events on the queue are consumed by IpmiRP. This "publish" approach
+ * avoids circular dependencies between the two components.
+ */
+ msg_q_t eventQueue(void)
+ { return iv_eventQ; }
+
+ /**
* @brief Constructor
*
* @parm void
@@ -156,6 +165,16 @@ class IpmiDD
*/
bool iv_eagains;
+ /**
+ * @brief Publishes changes to device state
+ *
+ * To clarify, IpmiDD does not consume any messages from this queue. The
+ * queue exists purely for the purpose of another component to consume IPMI
+ * hardware events (currently, IpmiRP). IpmiDD performs an asynchronous
+ * msg_send() to deliver the events to the listening task.
+ */
+ msg_q_t iv_eventQ;
+
// Disallow copying this class.
IpmiDD& operator=(const IpmiDD&);
IpmiDD(const IpmiDD&);
OpenPOWER on IntegriCloud