bnxt_en: refactor reset close code
[ Upstream commit 7474b1c82be3780692d537d331f9aa7fc1e5a368 ] Introduce bnxt_fw_fatal_close() API which can be used to stop data path and disable device when firmware is in fatal state. Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: a1acdc226bae ("bnxt_en: Fix the PCI-AER routines") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7e8e0e0ea4
commit
96ef658222
|
@ -11807,6 +11807,16 @@ static void bnxt_rx_ring_reset(struct bnxt *bp)
|
|||
bnxt_rtnl_unlock_sp(bp);
|
||||
}
|
||||
|
||||
static void bnxt_fw_fatal_close(struct bnxt *bp)
|
||||
{
|
||||
bnxt_tx_disable(bp);
|
||||
bnxt_disable_napi(bp);
|
||||
bnxt_disable_int_sync(bp);
|
||||
bnxt_free_irq(bp);
|
||||
bnxt_clear_int_mode(bp);
|
||||
pci_disable_device(bp->pdev);
|
||||
}
|
||||
|
||||
static void bnxt_fw_reset_close(struct bnxt *bp)
|
||||
{
|
||||
bnxt_ulp_stop(bp);
|
||||
|
@ -11820,12 +11830,7 @@ static void bnxt_fw_reset_close(struct bnxt *bp)
|
|||
pci_read_config_word(bp->pdev, PCI_SUBSYSTEM_ID, &val);
|
||||
if (val == 0xffff)
|
||||
bp->fw_reset_min_dsecs = 0;
|
||||
bnxt_tx_disable(bp);
|
||||
bnxt_disable_napi(bp);
|
||||
bnxt_disable_int_sync(bp);
|
||||
bnxt_free_irq(bp);
|
||||
bnxt_clear_int_mode(bp);
|
||||
pci_disable_device(bp->pdev);
|
||||
bnxt_fw_fatal_close(bp);
|
||||
}
|
||||
__bnxt_close_nic(bp, true, false);
|
||||
bnxt_vf_reps_free(bp);
|
||||
|
|
Loading…
Reference in New Issue