]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / bnx2x-Potential-race-after-iSCSI-boot.patch
CommitLineData
00e5a55c
BS
1From b4661739c67acd15a02f8e112f8cc52d24b609ed Mon Sep 17 00:00:00 2001
2From: Eilon Greenstein <eilong@broadcom.com>
3Date: Wed, 14 Jan 2009 06:43:56 +0000
4Subject: bnx2x: Potential race after iSCSI boot
5Acked-by: Karsten Keil <kkeil@novell.com>
6Reference: bnc#472500
7
8The lock was release too soon. Make sure the HW is marked as locked until the
9boot driver was unloaded from FW perspective
10
11Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
12Signed-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
17Index: 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