Re: [RFC net v2 3/3] bnxt_en: stop DMA before releasing rings the firmware did not free

From: Michael Chan

Date: Wed Sep 23 2026 - 00:44:00 EST


On Tue, Sep 22, 2026 at 11:24 AM Joe Damato <joe@xxxxxxx> wrote:

> @@ -7798,6 +7802,17 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
> bp->grp_info[i].cp_fw_ring_id = INVALID_HW_RING_ID;
> }
> }
> +
> + if (!stuck)
> + return;
> +
> + /* FW never acknowledged freeing these rings, so it may still be
> + * DMAing to them. Stop the device before handing memory back.
> + */
> + netdev_err(bp->dev,
> + "Firmware did not free %d ring(s); disabling DMA before releasing ring memory. A firmware reset is required.\n",
> + stuck);
> + pci_disable_device(bp->pdev);

I think it may be better to return error and let the caller decide
what actions to take. For example, bnxt_hwrm_resource_free() might
decide to finish all the remaining steps to free all the FW resources
before taking any actions. Disabling DMA now will prevent us from
sending any remaining messages to the FW to complete the shutdown.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature