bnxt_en: Don't query FW when netif_running() is false.
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Wed, 26 Aug 2020 05:08:32 +0000 (01:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:16 +0000 (19:14 +0200)
commit8fd4262bc8e4ca94cd1d6782ff49e59b1e91e849
tree92f0fcf0b86df28f24f3e8b6d4f863933a911a59
parentb12fefddb43f88be0c9764c9be4a2cf05e98115c
bnxt_en: Don't query FW when netif_running() is false.

[ Upstream commit c1c2d77408022a398a1a7c51cf20488c922629de ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c