diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2016-09-23 15:41:02 -0500 |
---|---|---|
committer | Matthew A. Ploetz <maploetz@us.ibm.com> | 2016-09-26 11:21:53 -0400 |
commit | 961ab83690e69c206387cecd6274339b4832168a (patch) | |
tree | 2607446bc8e35945929a6d3dfb6b8cdf383678a2 /src/usr/intr | |
parent | 56249539651bcb950d0710caf00674e6f99344c9 (diff) | |
download | talos-hostboot-961ab83690e69c206387cecd6274339b4832168a.tar.gz talos-hostboot-961ab83690e69c206387cecd6274339b4832168a.zip |
Handle Multiple LSI Interrupts Simultaneously
Change-Id: I1a2933ef948b370cffade723b3046f680169291a
CQ: SW367219
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30197
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Diffstat (limited to 'src/usr/intr')
-rw-r--r-- | src/usr/intr/intrrp.C | 77 |
1 files changed, 46 insertions, 31 deletions
diff --git a/src/usr/intr/intrrp.C b/src/usr/intr/intrrp.C index dcabd16f1..d7c7292d5 100644 --- a/src/usr/intr/intrrp.C +++ b/src/usr/intr/intrrp.C @@ -461,7 +461,7 @@ void IntrRp::msgHandler() case MSG_INTR_COALESCE: case MSG_INTR_EXTERN: { - ext_intr_t type = NO_INTERRUPT; + std::vector<ext_intr_t> l_pendingInterruptTypes; uint32_t ackResponse = static_cast<uint32_t>(msg->data[0]>>32); //Check if LSI-Based Interrupt @@ -474,9 +474,21 @@ void IntrRp::msgHandler() uint64_t lsiIntStatus = l_psihb_ptr->lsiintstatus; TRACFCOMP(g_trac_intr, "IntrRp::msgHandler() " "lsiIntStatus 0x%016lx", lsiIntStatus); - LSIvalue_t l_intrType = static_cast<LSIvalue_t> - (__builtin_clzl(lsiIntStatus)); - type = static_cast<ext_intr_t>(l_intrType); + + //Loop through each bit, and add any pending interrupts + // to list for later handling + for (uint8_t i=0; i < LSI_LAST_SOURCE; i++) + { + uint64_t lsiIntMask = 0x8000000000000000 >> i; + if (lsiIntMask & lsiIntStatus) + { + TRACDCOMP(g_trac_intr, "IntrRp::msgHandler() " + "Interrupt Type: %d found", i); + //Pending interrupt for this source type + l_pendingInterruptTypes.push_back( + static_cast<ext_intr_t>(i)); + } + } } // xirr was read by interrupt message handler. @@ -505,43 +517,46 @@ void IntrRp::msgHandler() msg_respond(iv_msgQ, msg); } - //Search if anyone is subscribed to the given - // interrupt source - Registry_t::iterator r = iv_registry.find(type); - - if(r != iv_registry.end() && type != INTERPROC_XISR) + for (auto l_type : l_pendingInterruptTypes) { - msg_q_t msgQ = r->second.msgQ; - - msg_t * rmsg = msg_allocate(); - rmsg->type = r->second.msgType; - rmsg->data[0] = type; // interrupt type - rmsg->data[1] = l_xirr_pir; - rmsg->extra_data = NULL; + //Search if anyone is subscribed to the given + // interrupt source + Registry_t::iterator r = iv_registry.find(l_type); - int rc = msg_sendrecv_noblk(msgQ,rmsg, iv_msgQ); - if(rc) + if(r != iv_registry.end() && l_type != INTERPROC_XISR) { - TRACFCOMP(g_trac_intr,ERR_MRK + msg_q_t msgQ = r->second.msgQ; + + msg_t * rmsg = msg_allocate(); + rmsg->type = r->second.msgType; + rmsg->data[0] = l_type; // interrupt type + rmsg->data[1] = l_xirr_pir; + rmsg->extra_data = NULL; + + int rc = msg_sendrecv_noblk(msgQ,rmsg, iv_msgQ); + if(rc) + { + TRACFCOMP(g_trac_intr,ERR_MRK "External Interrupt received type = %d, " "but could not send message to registered" " handler. Ignoring it. rc = %d", - (uint32_t) type, rc); + (uint32_t) l_type, rc); + } } - } - else if (type == LSI_PSU) - { - TRACFCOMP(g_trac_intr, "PSU Interrupt Detected"); - handlePsuInterrupt(type); - } - else // no queue registered for this interrupt type - { - // Throw it away for now. - TRACFCOMP(g_trac_intr,ERR_MRK + else if (l_type == LSI_PSU) + { + TRACFCOMP(g_trac_intr, "PSU Interrupt Detected"); + handlePsuInterrupt(l_type); + } + else // no queue registered for this interrupt type + { + // Throw it away for now. + TRACFCOMP(g_trac_intr,ERR_MRK "External Interrupt received type = %d, but " "nothing registered to handle it. " "Ignoring it.", - (uint32_t)type); + (uint32_t)l_type); + } } } break; |