Sophie

Sophie

distrib > Scientific%20Linux > 5x > i386 > by-pkgid > 351d529f9beeb4e5d936a6d5e3e7813a > files > 1388

kernel-2.6.18-128.29.1.el5.src.rpm

From: Jiri Pirko <jpirko@redhat.com>
Date: Thu, 25 Jun 2009 16:33:19 +0200
Subject: - [net] bnx2: fix problem of using wrong IRQ handler
Message-id: 20090625143318.GB9465@psychotron.englab.brq.redhat.com
O-Subject: [RHEL5.3.z patch] BZ503689 net: bnx2: Fix problem of using wrong IRQ handler.
Bugzilla: 503689
RH-Acked-by: Jiri Olsa <jolsa@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Neil Horman <nhorman@redhat.com>

[RHEL5.3.z patch] BZ503689 net: bnx2: Fix problem of using wrong IRQ handler.

Formal post of
http://people.redhat.com/agospoda/rhel5/0138-bnx2-fix-problem-using-wrong-irq-handler.patch

BZ503689
https://bugzilla.redhat.com/show_bug.cgi?id=503689

Description:
The MSI-X handler was chosen before the call to pci_enable_msix().
If MSI-X was not available, the wrong MSI-X handler would be used in
INTA mode.  This would cause a screaming interrupt problem because
INTA would not be cleared by the MSI-X handler.

Upstream:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=690103137267e9ed893febf7ff061af63e8235a9

Brew:
https://brewweb.devel.redhat.com/taskinfo?taskID=1856945

Test:
Tested by Andy.

Jirka

Signed-off-by: Andy Gospodarek <gospo@redhat.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 87e7e77..c74d27f 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -55,7 +55,7 @@
 #define FW_BUF_SIZE		0x10000
 #define DRV_MODULE_NAME		"bnx2"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"1.7.9-1"
+#define DRV_MODULE_VERSION	"1.7.9-2"
 #define DRV_MODULE_RELDATE	"July 18, 2008"
 
 #define RUN_AT(x) (jiffies + (x))
@@ -5819,6 +5819,7 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
 {
 	int i, rc;
 	struct msix_entry msix_ent[BNX2_MAX_MSIX_VEC];
+	const int len = sizeof(bp->irq_tbl[0].name);
 
 	bnx2_setup_msix_tbl(bp);
 	REG_WR(bp, BNX2_PCI_MSIX_CONTROL, BNX2_MAX_MSIX_HW_VEC - 1);
@@ -5828,9 +5829,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
 	for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
 		msix_ent[i].entry = i;
 		msix_ent[i].vector = 0;
-
-		strcpy(bp->irq_tbl[i].name, bp->dev->name);
-		bp->irq_tbl[i].handler = bnx2_msi_1shot;
 	}
 
 	rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
@@ -5839,8 +5837,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
 
 	bp->irq_nvecs = msix_vecs;
 	bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
-	for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
+	for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
 		bp->irq_tbl[i].vector = msix_ent[i].vector;
+		snprintf(bp->irq_tbl[i].name, len, "%s-%d", bp->dev->name, i);
+		bp->irq_tbl[i].handler = bnx2_msi_1shot;
+	}
 }
 
 static void