]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch
Merge branch 'master' into next
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.drivers / bnx2x-Potential-race-after-iSCSI-boot.patch
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>
6 Reference: bnc#472500
7
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
10
11 Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/bnx2x_main.c | 14 +++++++++-----
15 1 files changed, 9 insertions(+), 5 deletions(-)
16
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(
22 */
23 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
24 val = REG_RD(bp, DORQ_REG_NORM_CID_OFST);
25 - if (val == 0x7)
26 - REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
27 - bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
28 -
29 if (val == 0x7) {
30 u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
31 /* save our func */
32 @@ -6888,6 +6884,9 @@ static void __devinit bnx2x_undi_unload(
33 u32 swap_en;
34 u32 swap_val;
35
36 + /* clear the UNDI indication */
37 + REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
38 +
39 BNX2X_DEV_INFO("UNDI is active! reset device\n");
40
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);
44 }
45
46 + /* now it's safe to release the lock */
47 + bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
48 +
49 REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 :
50 HC_REG_CONFIG_0), 0x1000);
51
52 @@ -6957,7 +6959,9 @@ static void __devinit bnx2x_undi_unload(
53 bp->fw_seq =
54 (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) &
55 DRV_MSG_SEQ_NUMBER_MASK);
56 - }
57 +
58 + } else
59 + bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
60 }
61 }
62