If the firmware fails to respond a HWRM command in a certain time, it may be because the firmware is in a bad state. Do not send any new HWRM commands in such a scenario. Signed-off-by: Ajit Khaparde Reviewed-by: Damodharam Ammepalli --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 68c4778dc3..f7a60eb9a1 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -745,6 +745,7 @@ struct bnxt { #define BNXT_FLAG_DFLT_MAC_SET BIT(26) #define BNXT_FLAG_GFID_ENABLE BIT(27) #define BNXT_FLAG_CHIP_P7 BIT(30) +#define BNXT_FLAG_FW_TIMEDOUT BIT(31) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) #define BNXT_NPAR(bp) ((bp)->flags & BNXT_FLAG_NPAR_PF) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 67f8020e3c..ccc5417af1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -200,6 +200,10 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, if (bp->flags & BNXT_FLAG_FATAL_ERROR) return 0; + /* If previous HWRM command timed out, donot send new HWRM command */ + if (bp->flags & BNXT_FLAG_FW_TIMEDOUT) + return 0; + timeout = bp->hwrm_cmd_timeout; /* Update the message length for backing store config for new FW. */ @@ -300,6 +304,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, PMD_DRV_LOG(ERR, "Error(timeout) sending msg 0x%04x, seq_id %d\n", req->req_type, req->seq_id); + bp->flags |= BNXT_FLAG_FW_TIMEDOUT; return -ETIMEDOUT; } return 0; -- 2.39.2 (Apple Git-143)