* [PATCH net 3/5] bnx2x: prevent race between undi_unload and load flows
@ 2011-08-09 13:09 Dmitry Kravkov
2011-08-11 14:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Kravkov @ 2011-08-09 13:09 UTC (permalink / raw)
To: davem, netdev; +Cc: Vladislav Zolotarov, Eilon Greenstein
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_main.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 1507091..1f5467f 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -5798,6 +5798,12 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_ABS_FUNC(bp));
+ /*
+ * take the UNDI lock to protect undi_unload flow from accessing
+ * registers while we're resetting the chip
+ */
+ bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
+
bnx2x_reset_common(bp);
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff);
@@ -5808,6 +5814,8 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
}
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, val);
+ bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
+
bnx2x_init_block(bp, BLOCK_MISC, PHASE_COMMON);
if (!CHIP_IS_E1x(bp)) {
--
1.7.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 3/5] bnx2x: prevent race between undi_unload and load flows
2011-08-09 13:09 [PATCH net 3/5] bnx2x: prevent race between undi_unload and load flows Dmitry Kravkov
@ 2011-08-11 14:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-08-11 14:26 UTC (permalink / raw)
To: dmitry; +Cc: netdev, vladz, eilong
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Tue, 9 Aug 2011 16:09:52 +0300
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-11 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-09 13:09 [PATCH net 3/5] bnx2x: prevent race between undi_unload and load flows Dmitry Kravkov
2011-08-11 14:26 ` 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).