Skip to contentSkip to conversation

: Zero out context memory for 5709.

PATCH Applied Michael Chan 2 participants 2 messages Apr 30, 2008 – May 2, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 : Zero out context memory for 5709.

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

---
 drivers/net/bnx2.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/bnx2.c +5 -0
index b5560a9..d3d3342 100644
@@ -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);
Signature · 1 line
1.5.5.GIT