Commit 296802fe authored by Pavan Chebbi's avatar Pavan Chebbi Committed by Greg Kroah-Hartman

bnxt_en: Don't query FW when netif_running() is false.

[ Upstream commit c1c2d774 ]

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: db4723b3 ("bnxt_en: Check max_tx_scheduler_inputs value from firmware.")
Signed-off-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent da559d2e
...@@ -471,7 +471,7 @@ static void bnxt_get_channels(struct net_device *dev, ...@@ -471,7 +471,7 @@ static void bnxt_get_channels(struct net_device *dev,
int max_tx_sch_inputs; int max_tx_sch_inputs;
/* Get the most up-to-date 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); bnxt_hwrm_func_resc_qcaps(bp, false);
max_tx_sch_inputs = hw_resc->max_tx_sch_inputs; max_tx_sch_inputs = hw_resc->max_tx_sch_inputs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment