]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bnxt_en: Shutdown FW DMA in bnxt_shutdown()
authorMichael Chan <michael.chan@broadcom.com>
Tue, 4 Nov 2025 00:56:55 +0000 (16:56 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Nov 2025 01:25:19 +0000 (17:25 -0800)
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: 24d694aec139 ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 3fc33b1b4dfb143b31f15b53c2bc4720c0e872ae..c0e9caa1df735513214003376580ee02380be468 100644 (file)
@@ -16892,6 +16892,10 @@ static void bnxt_shutdown(struct pci_dev *pdev)
        if (netif_running(dev))
                netif_close(dev);
 
+       if (bnxt_hwrm_func_drv_unrgtr(bp)) {
+               pcie_flr(pdev);
+               goto shutdown_exit;
+       }
        bnxt_ptp_clear(bp);
        bnxt_clear_int_mode(bp);
        pci_disable_device(pdev);