1 From b4661739c67acd15a02f8e112f8cc52d24b609ed Mon Sep 17 00:00:00 2001
2 From: Eilon Greenstein <eilong@broadcom.com>
3 Date: Wed, 14 Jan 2009 06:43:56 +0000
4 Subject: bnx2x: Potential race after iSCSI boot
5 Acked-by: Karsten Keil <kkeil@novell.com>
8 The lock was release too soon. Make sure the HW is marked as locked until the
9 boot driver was unloaded from FW perspective
11 Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
14 drivers/net/bnx2x_main.c | 14 +++++++++-----
15 1 files changed, 9 insertions(+), 5 deletions(-)
17 Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
18 ===================================================================
19 --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c
20 +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
21 @@ -6877,10 +6877,6 @@ static void __devinit bnx2x_undi_unload(
23 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
24 val = REG_RD(bp, DORQ_REG_NORM_CID_OFST);
26 - REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
27 - bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
30 u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
32 @@ -6888,6 +6884,9 @@ static void __devinit bnx2x_undi_unload(
36 + /* clear the UNDI indication */
37 + REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
39 BNX2X_DEV_INFO("UNDI is active! reset device\n");
41 /* try unload UNDI on port 0 */
42 @@ -6913,6 +6912,9 @@ static void __devinit bnx2x_undi_unload(
43 bnx2x_fw_command(bp, reset_code);
46 + /* now it's safe to release the lock */
47 + bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
49 REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 :
50 HC_REG_CONFIG_0), 0x1000);
52 @@ -6957,7 +6959,9 @@ static void __devinit bnx2x_undi_unload(
54 (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) &
55 DRV_MSG_SEQ_NUMBER_MASK);
59 + bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);