Skip to content

Commit c20dc14

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Disable bus master during PCI shutdown and driver unload.
Some chips with older firmware can continue to perform DMA read from context memory even after the memory has been freed. In the PCI shutdown method, we need to call pci_disable_device() to shutdown DMA to prevent this DMA before we put the device into D3hot. DMA memory request in D3hot state will generate PCI fatal error. Similarly, in the driver remove method, the context memory should only be freed after DMA has been shutdown for correctness. Fixes: 98f04cf ("bnxt_en: Check context memory requirements from firmware.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7b75e49 commit c20dc14

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10262,10 +10262,10 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1026210262
bnxt_dcb_free(bp);
1026310263
kfree(bp->edev);
1026410264
bp->edev = NULL;
10265+
bnxt_cleanup_pci(bp);
1026510266
bnxt_free_ctx_mem(bp);
1026610267
kfree(bp->ctx);
1026710268
bp->ctx = NULL;
10268-
bnxt_cleanup_pci(bp);
1026910269
bnxt_free_port_stats(bp);
1027010270
free_netdev(dev);
1027110271
}
@@ -10859,6 +10859,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1085910859

1086010860
if (system_state == SYSTEM_POWER_OFF) {
1086110861
bnxt_clear_int_mode(bp);
10862+
pci_disable_device(pdev);
1086210863
pci_wake_from_d3(pdev, bp->wol);
1086310864
pci_set_power_state(pdev, PCI_D3hot);
1086410865
}

0 commit comments

Comments
 (0)