Re: [PATCH v2 08/14] NTB: ntb_transport: Stop RX tasklet scheduling before freeing a queue

From: Logan Gunthorpe

Date: Fri Sep 18 2026 - 12:14:55 EST




On 2026-09-09 22:08, Koichiro Den wrote:
> A caller can read qp->active before teardown clears it, then schedule
> the RX tasklet after tasklet_kill() returns. The MSI handler does not
> check active at all. Teardown also releases DMA channels before
> draining the tasklet.
>
> Protect active updates and the check-and-schedule sequence with
> rx_sched_lock, including the MSI path. Clear active under the lock,
> then drain the tasklet before releasing DMA channels or queue entries.
> QP link work is already disabled, so it cannot reactivate RX. Use a
> separate lock to avoid contention with RX list operations.
>
> Fixes: e902133162af ("ntb: stop tasklet from spinning forever during shutdown.")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>

Looks good to me.

Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>