From: Michael Chan Date: Fri, 2 May 2008 23:57:26 +0000 (-0700) Subject: bnx2: Zero out context memory for 5709. X-Git-Tag: v2.6.26-rc1~5^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=352f76879ebde543817360ce9c18c973d4300f4f;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Benjamin Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 0fcea859077..942ae06843b 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -2222,6 +2222,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);