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 <kicinski@meta.com> Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20251104005700.542174-2-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c383826 commit bc7208c

File tree

1 file changed

+4
-0
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+4
-0
lines changed

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)