diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-01-14 01:43:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-19 19:20:09 -0500 |
commit | b4661739c67acd15a02f8e112f8cc52d24b609ed (patch) | |
tree | f9cc188bc66fe5b92d64b7be3dfcc2768edc8731 /drivers/net/bnx2x_main.c | |
parent | 693fc0d14334859430733ab902adac182fdd8153 (diff) |
bnx2x: Potential race after iSCSI boot
The lock was release too soon. Make sure the HW is marked as locked until the
boot driver was unloaded from FW perspective
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 911067586a4a..70fc61033ddf 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -6874,10 +6874,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6874 | */ | 6874 | */ |
6875 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | 6875 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); |
6876 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); | 6876 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); |
6877 | if (val == 0x7) | ||
6878 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6879 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6880 | |||
6881 | if (val == 0x7) { | 6877 | if (val == 0x7) { |
6882 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; | 6878 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; |
6883 | /* save our func */ | 6879 | /* save our func */ |
@@ -6885,6 +6881,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6885 | u32 swap_en; | 6881 | u32 swap_en; |
6886 | u32 swap_val; | 6882 | u32 swap_val; |
6887 | 6883 | ||
6884 | /* clear the UNDI indication */ | ||
6885 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6886 | |||
6888 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); | 6887 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); |
6889 | 6888 | ||
6890 | /* try unload UNDI on port 0 */ | 6889 | /* try unload UNDI on port 0 */ |
@@ -6910,6 +6909,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6910 | bnx2x_fw_command(bp, reset_code); | 6909 | bnx2x_fw_command(bp, reset_code); |
6911 | } | 6910 | } |
6912 | 6911 | ||
6912 | /* now it's safe to release the lock */ | ||
6913 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6914 | |||
6913 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : | 6915 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : |
6914 | HC_REG_CONFIG_0), 0x1000); | 6916 | HC_REG_CONFIG_0), 0x1000); |
6915 | 6917 | ||
@@ -6954,7 +6956,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6954 | bp->fw_seq = | 6956 | bp->fw_seq = |
6955 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & | 6957 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & |
6956 | DRV_MSG_SEQ_NUMBER_MASK); | 6958 | DRV_MSG_SEQ_NUMBER_MASK); |
6957 | } | 6959 | |
6960 | } else | ||
6961 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6958 | } | 6962 | } |
6959 | } | 6963 | } |
6960 | 6964 | ||