Commit 0e0e3c53 authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

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: 8cc95ceb ("bnxt_en: improve fw diagnose devlink health messages")
Reviewed-by: default avatarVikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8cdb1592
...@@ -7789,6 +7789,19 @@ static int bnxt_map_fw_health_regs(struct bnxt *bp) ...@@ -7789,6 +7789,19 @@ static int bnxt_map_fw_health_regs(struct bnxt *bp)
return 0; return 0;
} }
static void bnxt_remap_fw_health_regs(struct bnxt *bp)
{
if (!bp->fw_health)
return;
if (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) {
bp->fw_health->status_reliable = true;
bp->fw_health->resets_reliable = true;
} else {
bnxt_try_map_fw_health_reg(bp);
}
}
static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp) static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp)
{ {
struct bnxt_fw_health *fw_health = bp->fw_health; struct bnxt_fw_health *fw_health = bp->fw_health;
...@@ -9856,8 +9869,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) ...@@ -9856,8 +9869,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
resc_reinit = true; resc_reinit = true;
if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE) if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE)
fw_reset = true; fw_reset = true;
else if (bp->fw_health && !bp->fw_health->status_reliable) else
bnxt_try_map_fw_health_reg(bp); bnxt_remap_fw_health_regs(bp);
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) {
netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment