Blame SOURCES/0072-netdrv-bnxt_en-Handle-RESET_NOTIFY-async-event-from-.patch

f95c89
From 03bfb6460688a8879a9a159167b3c8d36a4275ee Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:23:27 -0400
f95c89
Subject: [PATCH 72/96] [netdrv] bnxt_en: Handle RESET_NOTIFY async event from
f95c89
 firmware
f95c89
f95c89
Message-id: <3a807e3f42d2f73dd6a5c46ce3792861aabac0be.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276499
f95c89
O-Subject: [RHEL-8.2 PATCH 65/78] bnxt_en: Handle RESET_NOTIFY async event from firmware.
f95c89
Bugzilla: 1724766
f95c89
RH-Acked-by: John Linville <linville@redhat.com>
f95c89
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
f95c89
f95c89
This event from firmware signals a coordinated reset initiated by the
f95c89
firmware.  It may be triggered by some error conditions encountered
f95c89
in the firmware or other orderly reset conditions.
f95c89
f95c89
We store the parameters from this event.  Subsequent patches will
f95c89
add logic to handle reset itself using devlink reporters.
f95c89
f95c89
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
f95c89
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
f95c89
Signed-off-by: David S. Miller <davem@davemloft.net>
f95c89
(cherry picked from commit 2151fe0830fdb951f8ecfcfe67306fdef2366aa0)
f95c89
Bugzilla: 1724766
f95c89
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23809532
f95c89
Tested: build, boot, basic ping
f95c89
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
f95c89
---
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 +++++++++++
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  7 +++++++
f95c89
 2 files changed, 18 insertions(+)
f95c89
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:19.749476077 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:20.029473507 +0100
f95c89
@@ -254,6 +254,7 @@
f95c89
 	ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED,
f95c89
 	ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE,
f95c89
 	ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE,
f95c89
+	ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY,
f95c89
 	ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY,
f95c89
 };
f95c89
 
f95c89
@@ -1981,6 +1982,16 @@
f95c89
 			goto async_event_process_exit;
f95c89
 		set_bit(BNXT_RESET_TASK_SILENT_SP_EVENT, &bp->sp_event);
f95c89
 		break;
f95c89
+	case ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY:
f95c89
+		bp->fw_reset_timestamp = jiffies;
f95c89
+		bp->fw_reset_min_dsecs = cmpl->timestamp_lo;
f95c89
+		if (!bp->fw_reset_min_dsecs)
f95c89
+			bp->fw_reset_min_dsecs = BNXT_DFLT_FW_RST_MIN_DSECS;
f95c89
+		bp->fw_reset_max_dsecs = le16_to_cpu(cmpl->timestamp_hi);
f95c89
+		if (!bp->fw_reset_max_dsecs)
f95c89
+			bp->fw_reset_max_dsecs = BNXT_DFLT_FW_RST_MAX_DSECS;
f95c89
+		set_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event);
f95c89
+		break;
f95c89
 	case ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY: {
f95c89
 		struct bnxt_fw_health *fw_health = bp->fw_health;
f95c89
 		u32 data1 = le32_to_cpu(cmpl->event_data1);
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.h
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.h	2020-02-06 16:23:19.896474728 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.h	2020-02-06 16:23:20.029473507 +0100
f95c89
@@ -1719,6 +1719,13 @@
f95c89
 #define BNXT_FLOW_STATS_SP_EVENT	15
f95c89
 #define BNXT_UPDATE_PHY_SP_EVENT	16
f95c89
 #define BNXT_RING_COAL_NOW_SP_EVENT	17
f95c89
+#define BNXT_FW_RESET_NOTIFY_SP_EVENT	18
f95c89
+
f95c89
+	u16			fw_reset_min_dsecs;
f95c89
+#define BNXT_DFLT_FW_RST_MIN_DSECS	20
f95c89
+	u16			fw_reset_max_dsecs;
f95c89
+#define BNXT_DFLT_FW_RST_MAX_DSECS	60
f95c89
+	unsigned long		fw_reset_timestamp;
f95c89
 
f95c89
 	struct bnxt_fw_health	*fw_health;
f95c89