RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit
Subsystems (2)
PATCH 1/1 RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit
The SDMA state reference and completion cover the software cleanup tasklet, but not the hardware cleanup tasklet, err_halt_worker, or flush_worker. Queued instances can therefore access an SDMA engine after per_sdma is released.
After the state machine has stopped, cancel err_halt_worker first because it can publish the hardware cleanup tasklet. Then kill that tasklet and drain the remaining flush work.
--- drivers/infiniband/hw/hfi1/sdma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/hfi1/sdma.c +3 -0
@@ -1569,6 +1569,9 @@ void sdma_exit(struct hfi1_devdata *dd)* it is not running. */ sdma_finalput (&sde->state); +cancel_work_sync (&sde->err_halt_worker); +tasklet_kill (&sde->sdma_hw_clean_up_task); +cancel_work_sync (&sde->flush_worker); } }
Signature · 1 line
2.50.1.windows.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
The SDMA state reference and completion cover the software cleanup tasklet, but not the hardware cleanup tasklet,
err_halt_worker, orflush_worker. Queued instances can therefore access an SDMA engine afterper_sdmais released.After the state machine has stopped, cancel
err_halt_workerfirst because it can publish the hardware cleanup tasklet. Then kill that tasklet and drain the remaining flush work.Fixes 7724105686e7 ("IB/hfi1: add driver files")Signed-off-by Hongyan Xu <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Leon Romanovsky
AppliedQuoted 10 lines · Hongyan Xu
The SDMA state reference and completion cover the software cleanup tasklet, but not the hardware cleanup tasklet,
err_halt_worker, orflush_worker. Queued instances can therefore access an SDMA engine afterper_sdmais released.After the state machine has stopped, cancel
err_halt_workerfirst because it can publish the hardware cleanup tasklet. Then kill that tasklet and drain the remaining flush work.[...]
Applied, thanks!
[1/1] RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit
https://git.kernel.org/rdma/rdma/c/a57bf5ee252f5d
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>