Commit c921e4c4 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

[BNX2]: Fix bug in irq handler and add prefetch

Fix bug in bnx2_interrupt() that caused an unnecessary register read.
The BNX2_PCICFG_MISC_STATUS should only be read when the status tag
has not changed.

Add prefetch of the status block in bnx2_msi() similar to tg3_msi().
The status block is not touched in bnx2_msi() and prefetching it will
speed up bnx2_poll() that will run on the same CPU that received the
MSI.

Update version.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e66fc41
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#define DRV_MODULE_NAME "bnx2" #define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.2.20" #define DRV_MODULE_VERSION "1.2.21"
#define DRV_MODULE_RELDATE "August 22, 2005" #define DRV_MODULE_RELDATE "September 7, 2005"
#define RUN_AT(x) (jiffies + (x)) #define RUN_AT(x) (jiffies + (x))
...@@ -1533,6 +1533,7 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -1533,6 +1533,7 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs)
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct bnx2 *bp = dev->priv; struct bnx2 *bp = dev->priv;
prefetch(bp->status_blk);
REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
BNX2_PCICFG_INT_ACK_CMD_MASK_INT); BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
...@@ -1558,7 +1559,7 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -1558,7 +1559,7 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
* When using MSI, the MSI message will always complete after * When using MSI, the MSI message will always complete after
* the status block write. * the status block write.
*/ */
if ((bp->status_blk->status_idx == bp->last_status_idx) || if ((bp->status_blk->status_idx == bp->last_status_idx) &&
(REG_RD(bp, BNX2_PCICFG_MISC_STATUS) & (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
BNX2_PCICFG_MISC_STATUS_INTA_VALUE)) BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
return IRQ_NONE; return IRQ_NONE;
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#endif #endif
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/prefetch.h>
/* Hardware data structures and register definitions automatically /* Hardware data structures and register definitions automatically
* generated from RTL code. Do not modify. * generated from RTL code. Do not modify.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment