summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usr/mbox/mailboxsp.C47
-rw-r--r--src/usr/mbox/mailboxsp.H9
2 files changed, 21 insertions, 35 deletions
diff --git a/src/usr/mbox/mailboxsp.C b/src/usr/mbox/mailboxsp.C
index f869e5591..8b63fda00 100644
--- a/src/usr/mbox/mailboxsp.C
+++ b/src/usr/mbox/mailboxsp.C
@@ -461,7 +461,20 @@ void MailboxSp::handleNewMessage(msg_t * i_msg)
iv_respondq.insert(response);
}
- send_msg(&mbox_msg);
+ // NOTE:This message could still get sent if iv_suspended == true.
+ // This could happen if a suspend action has been requested, but the
+ // response to the suspend request has not yet been sent.
+ // (that is, the iv_sendq has not had a chance to "drain" yet.)
+ if(!iv_suspended)
+ {
+ send_msg(&mbox_msg);
+ }
+ else
+ {
+ iv_sendq.push_back(mbox_msg);
+ TRACFCOMP(g_trac_mbox,"I>Mailbox suspending or suspended.");
+ trace_msg("QUEUED",mbox_msg);
+ }
}
}
@@ -477,13 +490,9 @@ void MailboxSp::send_msg(mbox_msg_t * i_msg)
// Can't send now if:
// - busy (waiting for ACK)
// - a DMA buffer request is pending
- // - The mailbox is suspended
// - there is nothing to send
//
- // Future enhancement: If both iv_rts and iv_dma_pend are true then
- // could look for a mesaage from a different msgq in the sendq that does
- // not require a DMA buffer and send it.
- if(!iv_rts || iv_dma_pend || iv_suspended || iv_sendq.size() == 0)
+ if(!iv_rts || iv_dma_pend || iv_sendq.size() == 0)
{
return;
}
@@ -791,7 +800,6 @@ void MailboxSp::recv_msg(mbox_msg_t & i_mbox_msg)
mbox_msg.msg_payload.extra_data = NULL;
mbox_msg.msg_payload.__reserved__async = 0; // async
-
send_msg(&mbox_msg);
TRACFCOMP(g_trac_mbox,
@@ -1607,19 +1615,6 @@ void MailboxSp::handleShutdown()
void MailboxSp::suspend()
{
- // Mask interrupts in the mbox hardware
- errlHndl_t err = mboxddMaskInterrupts(iv_trgt);
- if(err) // SCOM failed.
- {
- // If this failed, the whole system is probably buggered up.
-
- errlCommit(err,MBOX_COMP_ID);
-
- TRACFCOMP(g_trac_mbox,
- ERR_MRK"MBOXSP Suspend. HALTED on critical error!");
- crit_assert(0);
- }
-
msg_respond(iv_msgQ,iv_suspend_msg);
TRACFCOMP(g_trac_mbox,INFO_MRK"Mailbox is suspended");
}
@@ -1630,18 +1625,6 @@ void MailboxSp::resume()
if(!iv_disabled)
{
- // Enable the mbox hardware
- errlHndl_t err = mboxInit(iv_trgt);
- if(err) // SCOM failed.
- {
- // If this failed, the whole system is probably buggered up.
-
- errlCommit(err,MBOX_COMP_ID);
-
- TRACFCOMP(g_trac_mbox,
- ERR_MRK"MBOXSP Resume. HALTED on critical error!");
- crit_assert(0);
- }
send_msg(); // send next message on queue
}
}
diff --git a/src/usr/mbox/mailboxsp.H b/src/usr/mbox/mailboxsp.H
index f7f205e96..13b8802dc 100644
--- a/src/usr/mbox/mailboxsp.H
+++ b/src/usr/mbox/mailboxsp.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -141,8 +141,11 @@ namespace MBOX
void msgHandler();
/**
- * Send or queue up a message to the device driver
- * @param[in] i_mbox_msg, the mailbox message
+ * Send or queue up the next message to the device driver
+ * @param[in] i_mbox_msg, ptr to the mailbox message | NULL
+ * @NOTE if the mailbox message ptr is NULL then no new message is
+ * added to the queue, but the next message on the queue is sent
+ * provided there is one available.
*/
void send_msg(mbox_msg_t * i_msg = NULL);
OpenPOWER on IntegriCloud