]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
bnxt_en: Improve logging of error recovery settings information.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 14 Feb 2021 23:05:01 +0000 (18:05 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:19:39 +0000 (10:19 +0100)
BugLink: https://bugs.launchpad.net/bugs/1948873
[ Upstream commit f4d95c3c194de04ae7b44f850131321c7ceb9312 ]

We currently only log the error recovery settings if it is enabled.
In some cases, firmware disables error recovery after it was
initially enabled.  Without logging anything, the user will not be
aware of this change in setting.

Log it when error recovery is disabled.  Also, change the reset count
value from hexadecimal to decimal.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 55838b9463a61cf32601e558db775b3671b0d2bc..bd024d79766676bc15376886a3919a90f95bf5f7 100644 (file)
@@ -2114,14 +2114,11 @@ static int bnxt_async_event_process(struct bnxt *bp,
 
                fw_health->enabled = EVENT_DATA1_RECOVERY_ENABLED(data1);
                fw_health->master = EVENT_DATA1_RECOVERY_MASTER_FUNC(data1);
-               if (!fw_health->enabled)
+               if (!fw_health->enabled) {
+                       netif_info(bp, drv, bp->dev,
+                                  "Error recovery info: error recovery[0]\n");
                        break;
-
-               netif_info(bp, drv, bp->dev,
-                          "Error recovery info: error recovery[%d], master[%d], reset count[0x%x], health status: 0x%x\n",
-                          fw_health->enabled, fw_health->master,
-                          bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG),
-                          bnxt_fw_health_readl(bp, BNXT_FW_HEALTH_REG));
+               }
                fw_health->tmr_multiplier =
                        DIV_ROUND_UP(fw_health->polling_dsecs * HZ,
                                     bp->current_interval * 10);
@@ -2130,6 +2127,10 @@ static int bnxt_async_event_process(struct bnxt *bp,
                        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);
+               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,
+                          bnxt_fw_health_readl(bp, BNXT_FW_HEALTH_REG));
                goto async_event_process_exit;
        }
        case ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION: