netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/6] [BNX2]: Zero out context memory for 5709.
@ 2008-04-30 22:51 Michael Chan
  2008-05-02 23:58 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2008-04-30 22:51 UTC (permalink / raw)
  To: davem, netdev; +Cc: benli, andy

[BNX2]: Zero out context memory for 5709.

We should zero out the context memory for 5709 before each reset.  When
we resume after suspend for example, the memory may not be zero and the
chip may not function correctly.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
 drivers/net/bnx2.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index b5560a9..d3d3342 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2220,6 +2220,11 @@ bnx2_init_5709_context(struct bnx2 *bp)
 	for (i = 0; i < bp->ctx_pages; i++) {
 		int j;
 
+		if (bp->ctx_blk[i])
+			memset(bp->ctx_blk[i], 0, BCM_PAGE_SIZE);
+		else
+			return -ENOMEM;
+
 		REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
 		       (bp->ctx_blk_mapping[i] & 0xffffffff) |
 		       BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
-- 
1.5.5.GIT




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

end of thread, other threads:[~2008-05-02 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30 22:51 [PATCH 4/6] [BNX2]: Zero out context memory for 5709 Michael Chan
2008-05-02 23:58 ` 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).