Skip to content

Commit bc7208c

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Shutdown FW DMA in bnxt_shutdown()
The netif_close() call in bnxt_shutdown() only stops packet DMA. There may be FW DMA for trace logging (recently added) that will continue. If we kexec to a new kernel, the DMA will corrupt memory in the new kernel. Add bnxt_hwrm_func_drv_unrgtr() to unregister the driver from the FW. This will stop the FW DMA. In case the call fails, call pcie_flr() to reset the function and stop the DMA. Fixes: 24d694a ("bnxt_en: Allocate backing store memory for FW trace logs") Reported-by: Jakub Kicinski <[email protected]> Reviewed-by: Damodharam Ammepalli <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c383826 commit bc7208c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • drivers/net/ethernet/broadcom/bnxt

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16892,6 +16892,10 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1689216892
if (netif_running(dev))
1689316893
netif_close(dev);
1689416894

16895+
if (bnxt_hwrm_func_drv_unrgtr(bp)) {
16896+
pcie_flr(pdev);
16897+
goto shutdown_exit;
16898+
}
1689516899
bnxt_ptp_clear(bp);
1689616900
bnxt_clear_int_mode(bp);
1689716901
pci_disable_device(pdev);

0 commit comments

Comments
 (0)