diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2015-11-13 06:37:28 -0600 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2015-12-11 15:30:29 -0600 |
commit | 8cfc6bc1244a80022848a30094b6ee027fc7cabc (patch) | |
tree | 6eb11c1ed1ec7dc643a9afefe10d18abd63a0347 /src/usr/mbox/mailboxsp.C | |
parent | 410f81eecdf73176049858cba338e5006b5da7fd (diff) | |
download | talos-hostboot-8cfc6bc1244a80022848a30094b6ee027fc7cabc.tar.gz talos-hostboot-8cfc6bc1244a80022848a30094b6ee027fc7cabc.zip |
Enable mailbox polling until P9 Interrupts are available
Change-Id: I57f85e9ea31f6176aa93a2041d8bda3a1bd8f5d7
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22020
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/mbox/mailboxsp.C')
-rw-r--r-- | src/usr/mbox/mailboxsp.C | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/usr/mbox/mailboxsp.C b/src/usr/mbox/mailboxsp.C index db3cc0979..3129d21a0 100644 --- a/src/usr/mbox/mailboxsp.C +++ b/src/usr/mbox/mailboxsp.C @@ -46,6 +46,7 @@ #include <sys/misc.h> #include <errl/errludprintk.H> #include <errno.h> +#include <sys/time.h> // Local functions namespace MBOX @@ -110,6 +111,47 @@ void* MailboxSp::msg_handler(void * unused) return NULL; } +// helper function to start mailbox message handler +// @todo RTC:126643 Remove poller when interrupts avail +void* MailboxSp::poller(void * unused) +{ + TRACFCOMP(g_trac_mbox, "start MBOX::pollTask"); + Singleton<MailboxSp>::instance().pollTask(); + return NULL; +} + +// @todo RTC:126643 Remove pollTask when interrupts avail +void MailboxSp::pollTask() +{ + int rc = 0; + + msg_q_t mboxQ = msg_q_resolve(VFS_ROOT_MSG_MBOX); + if(mboxQ) + { + while(!iv_disabled) + { + msg_t * msg = msg_allocate(); + msg->type = MSG_INTR; + msg->data[0] = 0; + msg->data[1] = 0; + + rc = msg_sendrecv(mboxQ, msg); + + msg_free(msg); + + if (rc) + { + TRACFCOMP(g_trac_mbox, ERR_MRK + "MBOX::pollTask msg_sendrecv() failed. errno = %d", + rc); + break; + } + + nanosleep(0, NS_PER_MSEC*100); + } + } +} + errlHndl_t MailboxSp::_init() { @@ -160,10 +202,12 @@ errlHndl_t MailboxSp::_init() return err; } +#if (0) // @todo RTC:126643 // Register to get interrupts for mailbox err = INTR::registerMsgQ(iv_msgQ, MSG_INTR, INTR::FSP_MAILBOX); +#endif if(err) { return err; @@ -195,6 +239,10 @@ errlHndl_t MailboxSp::_init() INITSERVICE::registerShutdownEvent(iv_msgQ, MSG_MBOX_SHUTDOWN, INITSERVICE::MBOX_PRIORITY); + + //@todo RTC:126643 -- poll mbox until interrupts are working + task_create(MailboxSp::poller, NULL); + } // else leave iv_disabled as true; @@ -245,8 +293,12 @@ void MailboxSp::msgHandler() { err = handleInterrupt(); +#if 0 // @todo RTC:126643 Remove poller and turn on when interrupts are working // Respond to the interrupt handler regardless of err INTR::sendEOI(iv_msgQ,msg); +#else + msg_respond(iv_msgQ,msg); +#endif // err will be set if scom failed in mbox DD // or MBOX_DATA_WRITE_ERR - serious - assert |