提交 641bdcd5 编写于 作者: M Michael Chan 提交者: David S. Miller

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

[Added return -EBUSY when the MEM_INIT bit doesn't clear, suggested
by Jeff Garzik.]
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Acked-by: NJeff Garzik <jeff@garzik.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7947b20e
...@@ -1778,6 +1778,15 @@ bnx2_init_5709_context(struct bnx2 *bp) ...@@ -1778,6 +1778,15 @@ bnx2_init_5709_context(struct bnx2 *bp)
val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12); val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12);
val |= (BCM_PAGE_BITS - 8) << 16; val |= (BCM_PAGE_BITS - 8) << 16;
REG_WR(bp, BNX2_CTX_COMMAND, val); 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);
}
if (val & BNX2_CTX_COMMAND_MEM_INIT)
return -EBUSY;
for (i = 0; i < bp->ctx_pages; i++) { for (i = 0; i < bp->ctx_pages; i++) {
int j; int j;
...@@ -3696,9 +3705,11 @@ bnx2_init_chip(struct bnx2 *bp) ...@@ -3696,9 +3705,11 @@ bnx2_init_chip(struct bnx2 *bp)
/* Initialize context mapping and zero out the quick contexts. The /* Initialize context mapping and zero out the quick contexts. The
* context block must have already been enabled. */ * context block must have already been enabled. */
if (CHIP_NUM(bp) == CHIP_NUM_5709) if (CHIP_NUM(bp) == CHIP_NUM_5709) {
bnx2_init_5709_context(bp); rc = bnx2_init_5709_context(bp);
else if (rc)
return rc;
} else
bnx2_init_context(bp); bnx2_init_context(bp);
if ((rc = bnx2_init_cpus(bp)) != 0) if ((rc = bnx2_init_cpus(bp)) != 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册