瀏覽代碼

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan 17 年之前
父節點
當前提交
352f76879e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/net/bnx2.c

+ 5 - 0
drivers/net/bnx2.c

@@ -2222,6 +2222,11 @@ bnx2_init_5709_context(struct bnx2 *bp)
 	for (i = 0; i < bp->ctx_pages; i++) {
 	for (i = 0; i < bp->ctx_pages; i++) {
 		int j;
 		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,
 		REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
 		       (bp->ctx_blk_mapping[i] & 0xffffffff) |
 		       (bp->ctx_blk_mapping[i] & 0xffffffff) |
 		       BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
 		       BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);