netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 24/34]bnx2x: Potential race after iSCSI boot
@ 2009-01-14 16:43 Eilon Greenstein
  2009-01-18  7:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eilon Greenstein @ 2009-01-14 16:43 UTC (permalink / raw)
  To: David Miller, netdev

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>
---
 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 e875dd2..5f0d2de 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -6909,10 +6909,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
 		 */
 		bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
 		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) {
 			u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
 			/* save our func */
@@ -6920,6 +6916,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
 			u32 swap_en;
 			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");
 
 			/* try unload UNDI on port 0 */
@@ -6945,6 +6944,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
 				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 :
 				    HC_REG_CONFIG_0), 0x1000);
 
@@ -6989,7 +6991,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
 			bp->fw_seq =
 			       (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) &
 				DRV_MSG_SEQ_NUMBER_MASK);
-		}
+
+		} else
+			bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
 	}
 }
 
-- 
1.5.4.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 24/34]bnx2x: Potential race after iSCSI boot
  2009-01-14 16:43 [PATCH 24/34]bnx2x: Potential race after iSCSI boot Eilon Greenstein
@ 2009-01-18  7:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-01-18  7:22 UTC (permalink / raw)
  To: eilong; +Cc: netdev

From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 14 Jan 2009 18:43:56 +0200

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-18  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:43 [PATCH 24/34]bnx2x: Potential race after iSCSI boot Eilon Greenstein
2009-01-18  7:22 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).