diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2013-11-17 01:59:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-18 15:45:44 -0500 |
commit | 9dcd9acd69b1321fa008c3ce3ec299d04cd46774 (patch) | |
tree | 450f5bd6a6e2f4f03842780e4dd7e0a19ba36eda /drivers/net/ethernet | |
parent | a0d307b21025106157709521d5b88831530e2112 (diff) |
bnx2x: Prevent panic during DMAE timeout
If chip enters a recovery flow just after the driver issues a DMAE request
the DMAE will timeout. Current code will cause a bnx2x_panic() as a result,
which means interface will no longer be usable (regardless of the recovery
results), as bnx2x_panic() is irreversible for the driver.
As this is a possible flow, the panic should be reached only when driver
is compiled with STOP_ON_ERROR.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index bb2f20291509..a4c2dc295344 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -577,7 +577,9 @@ void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, | |||
577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); | 577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
578 | if (rc) { | 578 | if (rc) { |
579 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 579 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
580 | #ifdef BNX2X_STOP_ON_ERROR | ||
580 | bnx2x_panic(); | 581 | bnx2x_panic(); |
582 | #endif | ||
581 | } | 583 | } |
582 | } | 584 | } |
583 | 585 | ||
@@ -614,7 +616,9 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32) | |||
614 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); | 616 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
615 | if (rc) { | 617 | if (rc) { |
616 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 618 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
619 | #ifdef BNX2X_STOP_ON_ERROR | ||
617 | bnx2x_panic(); | 620 | bnx2x_panic(); |
621 | #endif | ||
618 | } | 622 | } |
619 | } | 623 | } |
620 | 624 | ||
@@ -9352,6 +9356,10 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) | |||
9352 | bnx2x_process_kill_chip_reset(bp, global); | 9356 | bnx2x_process_kill_chip_reset(bp, global); |
9353 | barrier(); | 9357 | barrier(); |
9354 | 9358 | ||
9359 | /* clear errors in PGB */ | ||
9360 | if (!CHIP_IS_E1x(bp)) | ||
9361 | REG_WR(bp, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); | ||
9362 | |||
9355 | /* Recover after reset: */ | 9363 | /* Recover after reset: */ |
9356 | /* MCP */ | 9364 | /* MCP */ |
9357 | if (global && bnx2x_reset_mcp_comp(bp, val)) | 9365 | if (global && bnx2x_reset_mcp_comp(bp, val)) |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index 5ecf267dc4cc..3efbb35267c8 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
@@ -2864,6 +2864,17 @@ | |||
2864 | #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ 0x9430 | 2864 | #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ 0x9430 |
2865 | #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_WRITE 0x9434 | 2865 | #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_WRITE 0x9434 |
2866 | #define PGLUE_B_REG_INTERNAL_VFID_ENABLE 0x9438 | 2866 | #define PGLUE_B_REG_INTERNAL_VFID_ENABLE 0x9438 |
2867 | /* [W 7] Writing 1 to each bit in this register clears a corresponding error | ||
2868 | * details register and enables logging new error details. Bit 0 - clears | ||
2869 | * INCORRECT_RCV_DETAILS; Bit 1 - clears RX_ERR_DETAILS; Bit 2 - clears | ||
2870 | * TX_ERR_WR_ADD_31_0 TX_ERR_WR_ADD_63_32 TX_ERR_WR_DETAILS | ||
2871 | * TX_ERR_WR_DETAILS2 TX_ERR_RD_ADD_31_0 TX_ERR_RD_ADD_63_32 | ||
2872 | * TX_ERR_RD_DETAILS TX_ERR_RD_DETAILS2 TX_ERR_WR_DETAILS_ICPL; Bit 3 - | ||
2873 | * clears VF_LENGTH_VIOLATION_DETAILS. Bit 4 - clears | ||
2874 | * VF_GRC_SPACE_VIOLATION_DETAILS. Bit 5 - clears RX_TCPL_ERR_DETAILS. Bit 6 | ||
2875 | * - clears TCPL_IN_TWO_RCBS_DETAILS. */ | ||
2876 | #define PGLUE_B_REG_LATCHED_ERRORS_CLR 0x943c | ||
2877 | |||
2867 | /* [R 9] Interrupt register #0 read */ | 2878 | /* [R 9] Interrupt register #0 read */ |
2868 | #define PGLUE_B_REG_PGLUE_B_INT_STS 0x9298 | 2879 | #define PGLUE_B_REG_PGLUE_B_INT_STS 0x9298 |
2869 | /* [RC 9] Interrupt register #0 read clear */ | 2880 | /* [RC 9] Interrupt register #0 read clear */ |