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
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 @@
 	}
 
 	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;
 	}