netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kuba@kernel.org,
	Pavan Chebbi <pavan.chebbi@broadcom.com>
Subject: [PATCH net 1/8] bnxt_en: Don't query FW when netif_running() is false.
Date: Wed, 26 Aug 2020 01:08:32 -0400	[thread overview]
Message-ID: <1598418519-20168-2-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1598418519-20168-1-git-send-email-michael.chan@broadcom.com>

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

In rare conditions like two stage OS installation, the
ethtool's get_channels function may be called when the
device is in D3 state, leading to uncorrectable PCI error.
Check netif_running() first before making any query to FW
which involves writing to BAR.

Fixes: db4723b3cd2d ("bnxt_en: Check max_tx_scheduler_inputs value from firmware.")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 64da654..3890c1a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -806,7 +806,7 @@ static void bnxt_get_channels(struct net_device *dev,
 	int max_tx_sch_inputs;
 
 	/* Get the most up-to-date max_tx_sch_inputs. */
-	if (BNXT_NEW_RM(bp))
+	if (netif_running(dev) && BNXT_NEW_RM(bp))
 		bnxt_hwrm_func_resc_qcaps(bp, false);
 	max_tx_sch_inputs = hw_resc->max_tx_sch_inputs;
 
-- 
1.8.3.1


  reply	other threads:[~2020-08-26  5:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26  5:08 [PATCH net 0/8] bnxt_en: Bug fixes Michael Chan
2020-08-26  5:08 ` Michael Chan [this message]
2020-08-26  5:08 ` [PATCH net 2/8] bnxt_en: Check for zero dir entries in NVRAM Michael Chan
2020-08-26  5:08 ` [PATCH net 3/8] bnxt_en: Fix ethtool -S statitics with XDP or TCs enabled Michael Chan
2020-08-26  5:08 ` [PATCH net 4/8] bnxt_en: Fix PCI AER error recovery flow Michael Chan
2020-08-26  5:08 ` [PATCH net 5/8] bnxt_en: Fix possible crash in bnxt_fw_reset_task() Michael Chan
2020-08-26  5:08 ` [PATCH net 6/8] bnxt_en: fix HWRM error when querying VF temperature Michael Chan
2020-08-26  5:08 ` [PATCH net 7/8] bnxt_en: init RSS table for Minimal-Static VF reservation Michael Chan
2020-08-26  5:08 ` [PATCH net 8/8] bnxt_en: Setup default RSS map in all scenarios Michael Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1598418519-20168-2-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavan.chebbi@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).