bnxt_en: Re-write PCI BARs after PCI fatal error.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 26 Oct 2020 04:18:19 +0000 (00:18 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Oct 2020 01:26:35 +0000 (18:26 -0700)
commitf75d9a0aa96721d20011cd5f8c7a24eb32728589
tree137f7b1dbea97f5f4c5a480513c3208b2544b89d
parent631ce27a3006fc0b732bfd589c6df505f62eadd9
bnxt_en: Re-write PCI BARs after PCI fatal error.

When a PCIe fatal error occurs, the internal latched BAR addresses
in the chip get reset even though the BAR register values in config
space are retained.

pci_restore_state() will not rewrite the BAR addresses if the
BAR address values are valid, causing the chip's internal BAR addresses
to stay invalid.  So we need to zero the BAR registers during PCIe fatal
error to force pci_restore_state() to restore the BAR addresses.  These
write cycles to the BAR registers will cause the proper BAR addresses to
latch internally.

Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h