summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongyan Xu <getshell@seu.edu.cn>2026-09-28 21:41:48 +0800
committerLeon Romanovsky <leon@kernel.org>2026-09-30 08:08:34 -0400
commite95d076bc1fca7cc36fc8f2f0e9687f79fd314bd (patch)
treeb654911dde3612999b4b2469002445be27e8c2a8
parenta1c9d476c2316685f85fffb6450ad88d01836357 (diff)
downloadlinux-e95d076bc1fca7cc36fc8f2f0e9687f79fd314bd.tar.gz
linux-e95d076bc1fca7cc36fc8f2f0e9687f79fd314bd.zip
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. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Signed-off-by: Hongyan Xu <getshell@seu.edu.cn> Link: https://patch.msgid.link/20260928134148.977-1-getshell@seu.edu.cn Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/infiniband/hw/hfi1/sdma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index f253c8ee182d..a71fc8f2d37e 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -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);
}
}