diff options
author | Michael Chan <mchan@broadcom.com> | 2005-09-08 16:15:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-08 16:15:32 -0400 |
commit | c921e4c4dbb043f9435414c4e661e7f0a783053d (patch) | |
tree | 8cb7f7e657fae69a1f59509d586182a37c2635ed | |
parent | 2e66fc41169c90d93b7811caf7e7822de6aa2259 (diff) |
[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: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2.c | 7 | ||||
-rw-r--r-- | drivers/net/bnx2.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 55a72c7ad001..83598e32179c 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -14,8 +14,8 @@ | |||
14 | 14 | ||
15 | #define DRV_MODULE_NAME "bnx2" | 15 | #define DRV_MODULE_NAME "bnx2" |
16 | #define PFX DRV_MODULE_NAME ": " | 16 | #define PFX DRV_MODULE_NAME ": " |
17 | #define DRV_MODULE_VERSION "1.2.20" | 17 | #define DRV_MODULE_VERSION "1.2.21" |
18 | #define DRV_MODULE_RELDATE "August 22, 2005" | 18 | #define DRV_MODULE_RELDATE "September 7, 2005" |
19 | 19 | ||
20 | #define RUN_AT(x) (jiffies + (x)) | 20 | #define RUN_AT(x) (jiffies + (x)) |
21 | 21 | ||
@@ -1533,6 +1533,7 @@ bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs) | |||
1533 | struct net_device *dev = dev_instance; | 1533 | struct net_device *dev = dev_instance; |
1534 | struct bnx2 *bp = dev->priv; | 1534 | struct bnx2 *bp = dev->priv; |
1535 | 1535 | ||
1536 | prefetch(bp->status_blk); | ||
1536 | REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, | 1537 | REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, |
1537 | BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | | 1538 | BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | |
1538 | BNX2_PCICFG_INT_ACK_CMD_MASK_INT); | 1539 | BNX2_PCICFG_INT_ACK_CMD_MASK_INT); |
@@ -1558,7 +1559,7 @@ bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs) | |||
1558 | * When using MSI, the MSI message will always complete after | 1559 | * When using MSI, the MSI message will always complete after |
1559 | * the status block write. | 1560 | * the status block write. |
1560 | */ | 1561 | */ |
1561 | if ((bp->status_blk->status_idx == bp->last_status_idx) || | 1562 | if ((bp->status_blk->status_idx == bp->last_status_idx) && |
1562 | (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) & | 1563 | (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) & |
1563 | BNX2_PCICFG_MISC_STATUS_INTA_VALUE)) | 1564 | BNX2_PCICFG_MISC_STATUS_INTA_VALUE)) |
1564 | return IRQ_NONE; | 1565 | return IRQ_NONE; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 9ad3f5740cd8..62857b6a6ee4 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #endif | 50 | #endif |
51 | #include <linux/workqueue.h> | 51 | #include <linux/workqueue.h> |
52 | #include <linux/crc32.h> | 52 | #include <linux/crc32.h> |
53 | #include <linux/prefetch.h> | ||
53 | 54 | ||
54 | /* Hardware data structures and register definitions automatically | 55 | /* Hardware data structures and register definitions automatically |
55 | * generated from RTL code. Do not modify. | 56 | * generated from RTL code. Do not modify. |