Blame SOURCES/0062-netdrv-bnxt_en-Suppress-all-error-messages-in-hwrm_d.patch

f95c89
From 7368c8c1ff8c532df744d7e183507309cd4647f9 Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:23:17 -0400
f95c89
Subject: [PATCH 62/96] [netdrv] bnxt_en: Suppress all error messages in
f95c89
 hwrm_do_send_msg() in silent mode
f95c89
f95c89
Message-id: <8cb780ae7e85c9c31455263c9cb89b904e44e2c0.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276485
f95c89
O-Subject: [RHEL-8.2 PATCH 55/78] bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode.
f95c89
Bugzilla: 1724766
f95c89
RH-Acked-by: John Linville <linville@redhat.com>
f95c89
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
f95c89
f95c89
If the silent parameter is set, suppress all messages when there is
f95c89
no response from firmware.  When polling for firmware to come out of
f95c89
reset, no response may be normal and we want to suppress the error
f95c89
messages.  Also, don't poll for the firmware DMA response if Bus Master
f95c89
is disabled.  This is in preparation for error recovery when firmware
f95c89
may be in error or reset state or Bus Master is disabled.
f95c89
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 5bedb5296e33e889818d77c8ec69040481fab157)
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 | 27 +++++++++++++++++----------
f95c89
 1 file changed, 17 insertions(+), 10 deletions(-)
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:18.306489323 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:18.605486578 +0100
f95c89
@@ -4160,6 +4160,9 @@
f95c89
 	/* Ring channel doorbell */
f95c89
 	writel(1, bp->bar0 + doorbell_offset);
f95c89
 
f95c89
+	if (!pci_is_enabled(bp->pdev))
f95c89
+		return 0;
f95c89
+
f95c89
 	if (!timeout)
f95c89
 		timeout = DFLT_HWRM_CMD_TIMEOUT;
f95c89
 	/* convert timeout to usec */
f95c89
@@ -4191,8 +4194,9 @@
f95c89
 		}
f95c89
 
f95c89
 		if (bp->hwrm_intr_seq_id != (u16)~seq_id) {
f95c89
-			netdev_err(bp->dev, "Resp cmpl intr err msg: 0x%x\n",
f95c89
-				   le16_to_cpu(req->req_type));
f95c89
+			if (!silent)
f95c89
+				netdev_err(bp->dev, "Resp cmpl intr err msg: 0x%x\n",
f95c89
+					   le16_to_cpu(req->req_type));
f95c89
 			return -EBUSY;
f95c89
 		}
f95c89
 		len = (le32_to_cpu(*resp_len) & HWRM_RESP_LEN_MASK) >>
f95c89
@@ -4217,10 +4221,11 @@
f95c89
 		}
f95c89
 
f95c89
 		if (i >= tmo_count) {
f95c89
-			netdev_err(bp->dev, "Error (timeout: %d) msg {0x%x 0x%x} len:%d\n",
f95c89
-				   HWRM_TOTAL_TIMEOUT(i),
f95c89
-				   le16_to_cpu(req->req_type),
f95c89
-				   le16_to_cpu(req->seq_id), len);
f95c89
+			if (!silent)
f95c89
+				netdev_err(bp->dev, "Error (timeout: %d) msg {0x%x 0x%x} len:%d\n",
f95c89
+					   HWRM_TOTAL_TIMEOUT(i),
f95c89
+					   le16_to_cpu(req->req_type),
f95c89
+					   le16_to_cpu(req->seq_id), len);
f95c89
 			return -EBUSY;
f95c89
 		}
f95c89
 
f95c89
@@ -4235,10 +4240,12 @@
f95c89
 		}
f95c89
 
f95c89
 		if (j >= HWRM_VALID_BIT_DELAY_USEC) {
f95c89
-			netdev_err(bp->dev, "Error (timeout: %d) msg {0x%x 0x%x} len:%d v:%d\n",
f95c89
-				   HWRM_TOTAL_TIMEOUT(i),
f95c89
-				   le16_to_cpu(req->req_type),
f95c89
-				   le16_to_cpu(req->seq_id), len, *valid);
f95c89
+			if (!silent)
f95c89
+				netdev_err(bp->dev, "Error (timeout: %d) msg {0x%x 0x%x} len:%d v:%d\n",
f95c89
+					   HWRM_TOTAL_TIMEOUT(i),
f95c89
+					   le16_to_cpu(req->req_type),
f95c89
+					   le16_to_cpu(req->seq_id), len,
f95c89
+					   *valid);
f95c89
 			return -EBUSY;
f95c89
 		}
f95c89
 	}