From 7fed8988e7a76f7867566fb02f8d81b62a52fea0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Sep 2021 20:45:41 +0200 Subject: [PATCH] 5.14-stable patches added patches: bnxt_en-fix-error-recovery-regression.patch --- ...nxt_en-fix-error-recovery-regression.patch | 60 +++++++++++++++++++ queue-5.14/series | 1 + 2 files changed, 61 insertions(+) create mode 100644 queue-5.14/bnxt_en-fix-error-recovery-regression.patch diff --git a/queue-5.14/bnxt_en-fix-error-recovery-regression.patch b/queue-5.14/bnxt_en-fix-error-recovery-regression.patch new file mode 100644 index 00000000000..79dd3a2e63f --- /dev/null +++ b/queue-5.14/bnxt_en-fix-error-recovery-regression.patch @@ -0,0 +1,60 @@ +From eca4cf12acda306f851f6d2a05b1c9ef62cf0e81 Mon Sep 17 00:00:00 2001 +From: Michael Chan +Date: Sun, 12 Sep 2021 12:34:47 -0400 +Subject: bnxt_en: Fix error recovery regression + +From: Michael Chan + +commit eca4cf12acda306f851f6d2a05b1c9ef62cf0e81 upstream. + +The recent patch has introduced a regression by not reading the reset +count in the ERROR_RECOVERY async event handler. We may have just +gone through a reset and the reset count has just incremented. If +we don't update the reset count in the ERROR_RECOVERY event handler, +the health check timer will see that the reset count has changed and +will initiate an unintended reset. + +Restore the unconditional update of the reset count in +bnxt_async_event_process() if error recovery watchdog is enabled. +Also, update the reset count at the end of the reset sequence to +make it even more robust. + +Fixes: 1b2b91831983 ("bnxt_en: Fix possible unintended driver initiated error recovery") +Reviewed-by: Edwin Peer +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -2183,12 +2183,11 @@ static int bnxt_async_event_process(stru + DIV_ROUND_UP(fw_health->polling_dsecs * HZ, + bp->current_interval * 10); + fw_health->tmr_counter = fw_health->tmr_multiplier; +- if (!fw_health->enabled) { ++ if (!fw_health->enabled) + fw_health->last_fw_heartbeat = + bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG); +- fw_health->last_fw_reset_cnt = +- bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); +- } ++ fw_health->last_fw_reset_cnt = ++ bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); + netif_info(bp, drv, bp->dev, + "Error recovery info: error recovery[1], master[%d], reset count[%u], health status: 0x%x\n", + fw_health->master, fw_health->last_fw_reset_cnt, +@@ -12193,6 +12192,11 @@ static void bnxt_fw_reset_task(struct wo + return; + } + ++ if ((bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) && ++ bp->fw_health->enabled) { ++ bp->fw_health->last_fw_reset_cnt = ++ bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); ++ } + bp->fw_reset_state = 0; + /* Make sure fw_reset_state is 0 before clearing the flag */ + smp_mb__before_atomic(); diff --git a/queue-5.14/series b/queue-5.14/series index 7db1d87e265..2616cd8af1f 100644 --- a/queue-5.14/series +++ b/queue-5.14/series @@ -166,3 +166,4 @@ ip6_gre-revert-ip6_gre-add-validation-for-csum_start.patch mfd-lpc_sch-rename-gpiobase-to-prevent-build-error.patch cxgb3-fix-oops-on-module-removal.patch net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch +bnxt_en-fix-error-recovery-regression.patch -- 2.47.3