Skip to content

Commit 0e0e3c5

Browse files
Kalesh APdavem330
authored andcommitted
bnxt_en: Restore the resets_reliable flag in bnxt_open()
During ifdown, we call bnxt_inv_fw_health_reg() which will clear both the status_reliable and resets_reliable flags if these registers are mapped. This is correct because a FW reset during ifdown will clear these register mappings. If we detect that FW has gone through reset during the next ifup, we will remap these registers. But during normal ifup with no FW reset, we need to restore the resets_reliable flag otherwise we will not show the reset counter during devlink diagnose. Fixes: 8cc95ce ("bnxt_en: improve fw diagnose devlink health messages") Reviewed-by: Vikas Gupta <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Kalesh AP <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8cdb159 commit 0e0e3c5

File tree

1 file changed

+15
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+15
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7789,6 +7789,19 @@ static int bnxt_map_fw_health_regs(struct bnxt *bp)
77897789
return 0;
77907790
}
77917791

7792+
static void bnxt_remap_fw_health_regs(struct bnxt *bp)
7793+
{
7794+
if (!bp->fw_health)
7795+
return;
7796+
7797+
if (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) {
7798+
bp->fw_health->status_reliable = true;
7799+
bp->fw_health->resets_reliable = true;
7800+
} else {
7801+
bnxt_try_map_fw_health_reg(bp);
7802+
}
7803+
}
7804+
77927805
static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp)
77937806
{
77947807
struct bnxt_fw_health *fw_health = bp->fw_health;
@@ -9856,8 +9869,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
98569869
resc_reinit = true;
98579870
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE)
98589871
fw_reset = true;
9859-
else if (bp->fw_health && !bp->fw_health->status_reliable)
9860-
bnxt_try_map_fw_health_reg(bp);
9872+
else
9873+
bnxt_remap_fw_health_regs(bp);
98619874

98629875
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) {
98639876
netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n");

0 commit comments

Comments
 (0)