wctc4xxp: Handle all known interrupts regardless of mask.

When switching to polling mode it was possible that we would mask off the
receive complete interrupt until the next timer fired. Now go ahead and handle
anything we know how to handle regardless of the current mask.

Also, no need to update the reg local anymore since it isn't used to ack any
interrupts. We now always ack all the interrupts first and inspect them all.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Shaun Ruffell 2014-05-16 01:47:13 -05:00 committed by Russ Meyerriecks
parent cbe92363ea
commit 5981b152de

View File

@ -2670,7 +2670,9 @@ DAHDI_IRQ_HANDLER(wctc4xxp_interrupt)
{
struct wcdte *wc = dev_id;
u32 ints;
u32 reg;
#define NORMAL_INTERRUPT_SUMMARY (1<<16)
#define ABNORMAL_INTERRUPT_SUMMARY (1<<15)
#define TX_COMPLETE_INTERRUPT 0x00000001
#define RX_COMPLETE_INTERRUPT 0x00000040
#define TIMER_INTERRUPT (1<<11)
@ -2680,25 +2682,16 @@ DAHDI_IRQ_HANDLER(wctc4xxp_interrupt)
/* Read and clear interrupts */
ints = __wctc4xxp_getctl(wc, 0x0028);
ints &= wc->intmask;
if (!ints)
if (!(ints & (NORMAL_INTERRUPT_SUMMARY|ABNORMAL_INTERRUPT_SUMMARY)))
return IRQ_NONE;
/* Clear all the pending interrupts. */
__wctc4xxp_setctl(wc, 0x0028, ints);
if (likely(ints & NORMAL_INTERRUPTS)) {
reg = 0;
if (ints & TX_COMPLETE_INTERRUPT)
reg |= TX_COMPLETE_INTERRUPT;
if (ints & RX_COMPLETE_INTERRUPT) {
if (ints & (RX_COMPLETE_INTERRUPT | TIMER_INTERRUPT))
wctc4xxp_handle_receive_ring(wc);
reg |= RX_COMPLETE_INTERRUPT;
}
if (ints & TIMER_INTERRUPT) {
wctc4xxp_handle_receive_ring(wc);
reg |= TIMER_INTERRUPT;
}
#if DEFERRED_PROCESSING == WORKQUEUE
schedule_work(&wc->deferred_work);
@ -2709,7 +2702,6 @@ DAHDI_IRQ_HANDLER(wctc4xxp_interrupt)
#error "Define a deferred processing function in kernel/wctc4xxp/wctc4xxp.h"
#endif
__wctc4xxp_setctl(wc, 0x0028, reg);
} else {
if ((ints & 0x00008000) && debug)
dev_info(&wc->pdev->dev, "Abnormal Interrupt.\n");
@ -2736,9 +2728,6 @@ DAHDI_IRQ_HANDLER(wctc4xxp_interrupt)
dev_info(&wc->pdev->dev,
"Transmit Processor Stopped INT\n");
}
/* Clear all the pending interrupts. */
__wctc4xxp_setctl(wc, 0x0028, ints);
}
return IRQ_HANDLED;
}