aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2015-04-01 03:02:20 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-01 12:30:39 -0400
commitda254fbc6357a66a127e4e4e234b4f9c555d5ed1 (patch)
tree293c6edd632c457b30aae1048f76e510edd7bd60
parent3d6b72534a109be4353b161a09a5683b441d0941 (diff)
bnx2x: Fix kdump when iommu=on
When IOMM-vtd is active, once main kernel crashes unfinished DMAE transactions will be blocked, putting the HW in an error state which will cause further transactions to timeout. Current employed logic uses wrong macros, causing the first function to be the only function that cleanups that error state during its probe/load. This patch allows all the functions to successfully re-load in kdump kernel. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e6dec47fec68..1ec635f54994 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -7866,6 +7866,20 @@ int bnx2x_init_hw_func_cnic(struct bnx2x *bp)
7866 return 0; 7866 return 0;
7867} 7867}
7868 7868
7869/* previous driver DMAE transaction may have occurred when pre-boot stage ended
7870 * and boot began, or when kdump kernel was loaded. Either case would invalidate
7871 * the addresses of the transaction, resulting in was-error bit set in the pci
7872 * causing all hw-to-host pcie transactions to timeout. If this happened we want
7873 * to clear the interrupt which detected this from the pglueb and the was done
7874 * bit
7875 */
7876static void bnx2x_clean_pglue_errors(struct bnx2x *bp)
7877{
7878 if (!CHIP_IS_E1x(bp))
7879 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR,
7880 1 << BP_ABS_FUNC(bp));
7881}
7882
7869static int bnx2x_init_hw_func(struct bnx2x *bp) 7883static int bnx2x_init_hw_func(struct bnx2x *bp)
7870{ 7884{
7871 int port = BP_PORT(bp); 7885 int port = BP_PORT(bp);
@@ -7958,8 +7972,7 @@ static int bnx2x_init_hw_func(struct bnx2x *bp)
7958 7972
7959 bnx2x_init_block(bp, BLOCK_PGLUE_B, init_phase); 7973 bnx2x_init_block(bp, BLOCK_PGLUE_B, init_phase);
7960 7974
7961 if (!CHIP_IS_E1x(bp)) 7975 bnx2x_clean_pglue_errors(bp);
7962 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, func);
7963 7976
7964 bnx2x_init_block(bp, BLOCK_ATC, init_phase); 7977 bnx2x_init_block(bp, BLOCK_ATC, init_phase);
7965 bnx2x_init_block(bp, BLOCK_DMAE, init_phase); 7978 bnx2x_init_block(bp, BLOCK_DMAE, init_phase);
@@ -10588,26 +10601,6 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
10588 return bnx2x_prev_mcp_done(bp); 10601 return bnx2x_prev_mcp_done(bp);
10589} 10602}
10590 10603
10591/* previous driver DMAE transaction may have occurred when pre-boot stage ended
10592 * and boot began, or when kdump kernel was loaded. Either case would invalidate
10593 * the addresses of the transaction, resulting in was-error bit set in the pci
10594 * causing all hw-to-host pcie transactions to timeout. If this happened we want
10595 * to clear the interrupt which detected this from the pglueb and the was done
10596 * bit
10597 */
10598static void bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
10599{
10600 if (!CHIP_IS_E1x(bp)) {
10601 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
10602 if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
10603 DP(BNX2X_MSG_SP,
10604 "'was error' bit was found to be set in pglueb upon startup. Clearing\n");
10605 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR,
10606 1 << BP_FUNC(bp));
10607 }
10608 }
10609}
10610
10611static int bnx2x_prev_unload(struct bnx2x *bp) 10604static int bnx2x_prev_unload(struct bnx2x *bp)
10612{ 10605{
10613 int time_counter = 10; 10606 int time_counter = 10;
@@ -10617,7 +10610,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
10617 /* clear hw from errors which may have resulted from an interrupted 10610 /* clear hw from errors which may have resulted from an interrupted
10618 * dmae transaction. 10611 * dmae transaction.
10619 */ 10612 */
10620 bnx2x_prev_interrupted_dmae(bp); 10613 bnx2x_clean_pglue_errors(bp);
10621 10614
10622 /* Release previously held locks */ 10615 /* Release previously held locks */
10623 hw_lock_reg = (BP_FUNC(bp) <= 5) ? 10616 hw_lock_reg = (BP_FUNC(bp) <= 5) ?