Skip to contentSkip to conversation

cnic: Fix crash during bnx2x MTU change.

PATCH Applied Michael Chan 2 participants 2 messages Apr 6, 2010 – Apr 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cnic: Fix crash during bnx2x MTU change.

cnic_service_bnx2x() irq handler can be called during chip reset from MTU change. Need to check that the cnic's device state is up before handling the irq.

---
 drivers/net/cnic.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/cnic.c +5 -5
index 9781942..4b451a7 100644
@@ -2334,13 +2334,13 @@ static int cnic_service_bnx2x(void *data, void *status_blk)
 	struct cnic_local *cp = dev->cnic_priv;
 	u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX;
 
-	prefetch(cp->status_blk.bnx2x);
-	prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
+	if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) {
+		prefetch(cp->status_blk.bnx2x);
+		prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
 
-	if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags)))
 		tasklet_schedule(&cp->cnic_irq_task);
-
-	cnic_chk_pkt_rings(cp);
+		cnic_chk_pkt_rings(cp);
+	}
 
 	return 0;
 }
Signature · 1 line
1.6.4.GIT
maintainer Applied
#1 lore raw

From: "Michael Chan" <[email protected]>
Date: Mon, 5 Apr 2010 18:44:01 -0700

Quoted 5 lines

cnic_service_bnx2x() irq handler can be called during chip reset from MTU change. Need to check that the cnic's device state is up before handling the irq.

Applied to net-2.6, thanks.