• Michael Chan's avatar
    bnxt_en: Improve the status_reliable flag in bp->fw_health. · 43a440c4
    Michael Chan authored
    In order to read the firmware health status, we first need to determine
    the register location and then the register may need to be mapped.
    There are 2 code paths to do this.  The first one is done early as a
    best effort attempt by the function bnxt_try_map_fw_health_reg().  The
    second one is done later in the function bnxt_map_fw_health_regs()
    after establishing communications with the firmware.  We currently
    only set fw_health->status_reliable if we can successfully set up the
    health register in the first code path.
    
    Improve the scheme by setting the fw_health->status_reliable flag if
    either (or both) code paths can successfully set up the health
    register.  This flag is relied upon during run-time when we need to
    check the health status.  So this will make it work better.
    
    During ifdown, if the health register is mapped, we need to invalidate
    the health register mapping because a potential fw reset will reset
    the mapping.  Similarly, we need to do the same after firmware reset
    during recovery.  We'll remap it during ifup.
    Reviewed-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
    Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    43a440c4
bnxt.c 349 KB