diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-08-12 04:23:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 02:02:48 -0400 |
commit | e3553b29c6f395c6692afccc2ed5eff9c3d1daef (patch) | |
tree | f41aae782d997cb936bdf75187ed7a480fc8536f | |
parent | df4770de03d2eec3f66b0ac4d2248d471a1ccc0b (diff) |
bnx2x: Stop loading if error condition detected
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2x.h | 1 | ||||
-rw-r--r-- | drivers/net/bnx2x_main.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 004f4a8e1649..633acca4a988 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -89,6 +89,7 @@ | |||
89 | } while (0) | 89 | } while (0) |
90 | #else | 90 | #else |
91 | #define bnx2x_panic() do { \ | 91 | #define bnx2x_panic() do { \ |
92 | bp->panic = 1; \ | ||
92 | BNX2X_ERR("driver assert\n"); \ | 93 | BNX2X_ERR("driver assert\n"); \ |
93 | bnx2x_panic_dump(bp); \ | 94 | bnx2x_panic_dump(bp); \ |
94 | } while (0) | 95 | } while (0) |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 8e77e933ac18..c289670a55af 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -7109,6 +7109,9 @@ static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx, | |||
7109 | } | 7109 | } |
7110 | 7110 | ||
7111 | msleep(1); | 7111 | msleep(1); |
7112 | |||
7113 | if (bp->panic) | ||
7114 | return -EIO; | ||
7112 | } | 7115 | } |
7113 | 7116 | ||
7114 | /* timeout! */ | 7117 | /* timeout! */ |
@@ -7373,7 +7376,12 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
7373 | rc = bnx2x_setup_leading(bp); | 7376 | rc = bnx2x_setup_leading(bp); |
7374 | if (rc) { | 7377 | if (rc) { |
7375 | BNX2X_ERR("Setup leading failed!\n"); | 7378 | BNX2X_ERR("Setup leading failed!\n"); |
7379 | #ifndef BNX2X_STOP_ON_ERROR | ||
7376 | goto load_error3; | 7380 | goto load_error3; |
7381 | #else | ||
7382 | bp->panic = 1; | ||
7383 | return -EBUSY; | ||
7384 | #endif | ||
7377 | } | 7385 | } |
7378 | 7386 | ||
7379 | if (CHIP_IS_E1H(bp)) | 7387 | if (CHIP_IS_E1H(bp)) |