be2net: fix spurious interrupt handling in intx mode
authorSathya Perla <sathyap@serverengines.com>
Wed, 1 Jul 2009 01:06:07 +0000 (01:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Jul 2009 03:09:45 +0000 (20:09 -0700)
Occasionally we may see an interrupt without an event in the eq.
In intx, we currently see the event queue and return IRQ_NONE causing
a the irq to be disabled ("no one cared".) Instead, read the CEV_ISR
reg to check the existence of the interrupt.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_hw.h
drivers/net/benet/be_main.c

index b02e805c1db37c8e645510b6b479905b74d19e56..29c33c709c6d11262024d46768870ffc53921c6e 100644 (file)
 #define MEMBAR_CTRL_INT_CTRL_PFUNC_MASK        0x7     /* bits 26 - 28 */
 #define MEMBAR_CTRL_INT_CTRL_PFUNC_SHIFT       26
 
+/********* ISR0 Register offset **********/
+#define CEV_ISR0_OFFSET                        0xC18
+#define CEV_ISR_SIZE                           4
+
 /********* Event Q door bell *************/
 #define DB_EQ_OFFSET                   DB_CQ_OFFSET
 #define DB_EQ_RING_ID_MASK             0x1FF   /* bits 0 - 8 */
index 308eb09ca56bb14f30849517eac62852c9b4e9ad..c43f6a119295097ac2c44d1040b38ae39502e1b8 100644 (file)
@@ -1274,15 +1274,17 @@ static irqreturn_t be_intx(int irq, void *dev)
 {
        struct be_adapter *adapter = dev;
        struct be_ctrl_info *ctrl = &adapter->ctrl;
-       int rx, tx;
+        int isr;
 
-       tx = event_handle(ctrl, &adapter->tx_eq);
-       rx = event_handle(ctrl, &adapter->rx_eq);
+       isr = ioread32(ctrl->csr + CEV_ISR0_OFFSET +
+                      ctrl->pci_func * CEV_ISR_SIZE);
+       if (!isr)
+                return IRQ_NONE;
 
-       if (rx || tx)
-               return IRQ_HANDLED;
-       else
-               return IRQ_NONE;
+        event_handle(ctrl, &adapter->tx_eq);
+        event_handle(ctrl, &adapter->rx_eq);
+
+        return IRQ_HANDLED;
 }
 
 static irqreturn_t be_msix_rx(int irq, void *dev)