Commit b4661739 authored by Eilon Greenstein's avatar Eilon Greenstein Committed by David S. Miller

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: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 693fc0d1
...@@ -6874,10 +6874,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) ...@@ -6874,10 +6874,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
*/ */
bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); val = REG_RD(bp, DORQ_REG_NORM_CID_OFST);
if (val == 0x7)
REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
if (val == 0x7) { if (val == 0x7) {
u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
/* save our func */ /* save our func */
...@@ -6885,6 +6881,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) ...@@ -6885,6 +6881,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
u32 swap_en; u32 swap_en;
u32 swap_val; u32 swap_val;
/* clear the UNDI indication */
REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
BNX2X_DEV_INFO("UNDI is active! reset device\n"); BNX2X_DEV_INFO("UNDI is active! reset device\n");
/* try unload UNDI on port 0 */ /* try unload UNDI on port 0 */
...@@ -6910,6 +6909,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) ...@@ -6910,6 +6909,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
bnx2x_fw_command(bp, reset_code); bnx2x_fw_command(bp, reset_code);
} }
/* now it's safe to release the lock */
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 :
HC_REG_CONFIG_0), 0x1000); HC_REG_CONFIG_0), 0x1000);
...@@ -6954,7 +6956,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) ...@@ -6954,7 +6956,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
bp->fw_seq = bp->fw_seq =
(SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) &
DRV_MSG_SEQ_NUMBER_MASK); DRV_MSG_SEQ_NUMBER_MASK);
}
} else
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment