summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2017-09-20 18:03:35 +1000
committerSuraj Jitindar Singh <sjitindarsingh@gmail.com>2017-09-20 18:33:19 +1000
commit7760fd8f8e6939231ea819ec4744535d019a2d4c (patch)
tree7c3cf94f722e97c78d5f4d26d901ab31d2ecacbf
parent97578a6b567c262c327ea44711c5030c8e00ff9d (diff)
downloadphosphor-mboxbridge-7760fd8f8e6939231ea819ec4744535d019a2d4c.tar.gz
phosphor-mboxbridge-7760fd8f8e6939231ea819ec4744535d019a2d4c.zip
mboxd/dbus: Unconditionally send BMC EVENT to host on resume
The "BMC Flash Control Lost" BMC Event (0x40) is used to signal to the host that the daemon has been suspended, such as by mboxctl --suspend. When resumed, such as by mboxctl --resume, the bit is cleared and this is again communicated to the host. When the resume command is called with clean the clearing of this bit is communicated to the host unconditionally. However when resume is called with modified we rely on the reset windows function to communicate this to the host at the same time it tells the host that the active window has been closed. However the reset windows function is only called if there was indeed an active window. This means that when resume is called with modified and there isn't an active window, the host is never told that the daemon has been resumed. Fix this by communicating the BMC event to the host unconditionally on resume irrespective of the argument. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Change-Id: I2e921d897476a9e34516f8929e713057ea0622a4
-rw-r--r--mboxd_dbus.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mboxd_dbus.c b/mboxd_dbus.c
index 6673ca6..6493ccf 100644
--- a/mboxd_dbus.c
+++ b/mboxd_dbus.c
@@ -241,16 +241,13 @@ static int dbus_handle_resume(struct mbox_context *context,
}
if (req->args[0] == RESUME_FLASH_MODIFIED) {
- /* Clear the bit and call the flash modified handler */
- clr_bmc_events(context, BMC_EVENT_FLASH_CTRL_LOST,
- NO_BMC_EVENT);
- rc = dbus_handle_modified(context, req, resp);
- } else {
- /* Flash wasn't modified - just clear the bit with writeback */
- rc = clr_bmc_events(context, BMC_EVENT_FLASH_CTRL_LOST,
- SET_BMC_EVENT);
+ /* Call the flash modified handler */
+ dbus_handle_modified(context, req, resp);
}
+ /* Clear the bit and send the BMC Event to the host */
+ rc = clr_bmc_events(context, BMC_EVENT_FLASH_CTRL_LOST, SET_BMC_EVENT);
+
if (rc < 0) {
rc = -E_DBUS_HARDWARE;
}
OpenPOWER on IntegriCloud