Re: [PATCH rdma] RDMA/mlx5: Cancel software CQ notifications before teardown
From: Leon Romanovsky
Date: Mon Oct 12 2026 - 03:54:55 EST
On Thu, Oct 08, 2026 at 03:12:02PM +0100, Prathamesh Deshpande wrote:
> GSI completions queue notify_work to invoke the CQ completion handler.
> CQ destruction drains hardware events and core polling, but does not
> cancel this software notifier. Queued or running work can therefore
> access a freed CQ, or restart polling after ib_free_cq() has drained it.
>
> Cancel notify_work in the pre-destroy callback, before core polling is
> stopped and CQ memory is released. Skip user CQs, which do not initialize
> this work item.
>
> Fixes: 25361e02c448 ("IB/mlx5: Generate completions in software")
> Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@xxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx5/cq.c | 3 +++
> 1 file changed, 3 insertions(+)
I applied the patch because the change is worthwhile, but the description is
incorrect. GSI is handled internally by mlx5 CQs and QPs and is stopped
before the CQ is destroyed.
Thanks