RDMA/hfi1: shut down the trap timer before unregistering
Subsystems (2)
PATCH 1/1 RDMA/hfi1: shut down the trap timer before unregistering
MAD processing arms a trap timer embedded in each hfi1_ibport. Device unregistration does not stop the timer, so its callback can run after the port and its containing hfi1_devdata have been released.
Shut down every port timer before unregistering the IB device. The shutdown form also prevents a concurrent path from rearming the timer.
--- drivers/infiniband/hw/hfi1/verbs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/infiniband/hw/hfi1/verbs.c +4 -0
@@ -1888,6 +1888,10 @@ err_verbs_txreq:void hfi1_unregister_ib_device (struct hfi1_devdata *dd) {struct hfi1_ibdev *dev = &dd->verbs_dev; +int i; + +for (i =0 ; i < dd->num_pports; i++) +timer_shutdown_sync (&dd->pport[i].ibport_data.rvp.trap_timer);hfi1_verbs_unregister_sysfs (dd);
Signature · 1 line
2.50.1.windows.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines
MAD processing arms a trap timer embedded in each
hfi1_ibport. Device unregistration does not stop the timer, so its callback can run after the port and its containinghfi1_devdatahave been released.Shut down every port timer before unregistering the IB device. The shutdown form also prevents a concurrent path from rearming the timer.
Fixes bf90aadd630c ("IB/hfi1: Send MAD traps until repressed")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 8 lines · Hongyan Xu
MAD processing arms a trap timer embedded in each
hfi1_ibport. Device unregistration does not stop the timer, so its callback can run after the port and its containinghfi1_devdatahave been released.Shut down every port timer before unregistering the IB device. The shutdown form also prevents a concurrent path from rearming the timer.
[...]
Applied, thanks!
[1/1] RDMA/hfi1: shut down the trap timer before unregistering
https://git.kernel.org/rdma/rdma/c/23baaac7287bd6
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>