netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2/5][BNX2]: Add missing wait in bnx2_init_5709_context().
@ 2007-06-05  0:00 Michael Chan
  2007-06-04 23:39 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Chan @ 2007-06-05  0:00 UTC (permalink / raw)
  To: davem; +Cc: andy, netdev

[BNX2]: Add missing wait in bnx2_init_5709_context().

For correctness, we need to wait for the MEM_INIT bit to be cleared
in the BNX2_CTX_COMMAND register before proceeding.

Signed-off-by: Michael Chan <mchan@broadcom.com>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 5d69e5b..daa62d9 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -1778,6 +1778,12 @@ bnx2_init_5709_context(struct bnx2 *bp)
 	val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12);
 	val |= (BCM_PAGE_BITS - 8) << 16;
 	REG_WR(bp, BNX2_CTX_COMMAND, val);
+	for (i = 0; i < 10; i++) {
+		val = REG_RD(bp, BNX2_CTX_COMMAND);
+		if (!(val & BNX2_CTX_COMMAND_MEM_INIT))
+			break;
+		udelay(2);
+	}
 	for (i = 0; i < bp->ctx_pages; i++) {
 		int j;
 



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

end of thread, other threads:[~2007-06-05  4:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05  0:00 [2/5][BNX2]: Add missing wait in bnx2_init_5709_context() Michael Chan
2007-06-04 23:39 ` Jeff Garzik
2007-06-05  0:58   ` [2/5 revised][BNX2]: " Michael Chan
2007-06-05  1:23     ` Jeff Garzik
2007-06-05  4: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).