Skip to contentSkip to conversation

bnx2x: Stop loading if error condition detected

PATCH In review Eilon Greenstein 1 participant 1 message Aug 12, 2009

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

PATCH 19/36 bnx2x: Stop loading if error condition detected

---
 drivers/net/bnx2x.h      |    1 +
 drivers/net/bnx2x_main.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
drivers/net/bnx2x.h +1 -0
index 004f4a8..633acca 100644
@@ -89,6 +89,7 @@
 	} while (0)
 #else
 #define bnx2x_panic() do { \
+		bp->panic = 1; \
 		BNX2X_ERR("driver assert\n"); \
 		bnx2x_panic_dump(bp); \
 	} while (0)
drivers/net/bnx2x_main.c +8 -0
index 9eea52d..8e32134 100644
@@ -7108,6 +7108,9 @@ static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
 		}
 
 		msleep(1);
+
+		if (bp->panic)
+			return -EIO;
 	}
 
 	/* timeout! */
@@ -7372,7 +7375,12 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
 	rc = bnx2x_setup_leading(bp);
 	if (rc) {
 		BNX2X_ERR("Setup leading failed!\n");
+#ifndef BNX2X_STOP_ON_ERROR
 		goto load_error3;
+#else
+		bp->panic = 1;
+		return -EBUSY;
+#endif
 	}
 
 	if (CHIP_IS_E1H(bp))
Signature · 1 line
1.5.4.3