Skip to content

Commit 93e4dba

Browse files
sudhakar-dindukurtiSomasundaram Krishnasamy
authored andcommitted
A/A Bonding: Miscellaneous module unload changes
The following changes are done as part of this change 1) destroy_workqueue() calls flush_workqueue() internally. Hence removed calling flush_workqueue() explicitly from the Resilient RDMAIP module. 2) Moved unregister_ib_client() to after calling rdmaip_restore_ips(). Resilient RDMAIP module IB client callback will be invoked by the IB core informs about the device removal for all the IB core clients. In the callback, rdmaip_dev structure will be deallocated. It is good to move the deallocation after rdmaip_restpore_ips() to avoid crashed due to access to the deallocated memory. 3) In rdmaip_init() function, if creating rdmaip_garps_wq fails, destroy_workqueue(rdmaip_wq) is called in the failure path. This is not needed as rdmaip_cleanup() takes care of this. Orabug: 29781216 Signed-off-by: Sudhakar Dindukurti <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent d90ad15 commit 93e4dba

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/infiniband/core/rdmaip.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,13 +2541,11 @@ void rdmaip_destroy_workqs(void)
25412541

25422542
if (rdmaip_init_flag & RDMAIP_IP_WQ_CREATED) {
25432543
cancel_delayed_work_sync(&riif_dlywork);
2544-
flush_workqueue(rdmaip_wq);
25452544
destroy_workqueue(rdmaip_wq);
25462545
rdmaip_init_flag &= ~RDMAIP_IP_WQ_CREATED;
25472546
}
25482547

25492548
if (rdmaip_init_flag & RDMAIP_GARPS_WQ_CREATED) {
2550-
flush_workqueue(rdmaip_garps_wq);
25512549
destroy_workqueue(rdmaip_garps_wq);
25522550
rdmaip_init_flag &= ~RDMAIP_GARPS_WQ_CREATED;
25532551
}
@@ -2759,17 +2757,17 @@ void rdmaip_cleanup(void)
27592757

27602758
rdmaip_destroy_workqs();
27612759

2762-
if (rdmaip_init_flag & RDMAIP_IB_REG) {
2763-
ib_unregister_client(&rdmaip_client);
2764-
rdmaip_init_flag &= ~RDMAIP_IB_REG;
2765-
}
2766-
27672760
/*
27682761
* After this point, no rdmaip callbacks will be called
27692762
* by other frameworks. Clean up all the resources.
27702763
*/
27712764
rdmaip_restore_ip_addresses();
27722765

2766+
if (rdmaip_init_flag & RDMAIP_IB_REG) {
2767+
ib_unregister_client(&rdmaip_client);
2768+
rdmaip_init_flag &= ~RDMAIP_IB_REG;
2769+
}
2770+
27732771
if (rdmaip_init_flag & RDMAIP_REG_NET_SYSCTL) {
27742772
unregister_net_sysctl_table(rdmaip_sysctl_hdr);
27752773
rdmaip_init_flag &= ~RDMAIP_REG_NET_SYSCTL;
@@ -2894,7 +2892,6 @@ int rdmaip_init(void)
28942892
rdmaip_garps_wq = create_workqueue("rdmaip_garps");
28952893
if (!rdmaip_garps_wq) {
28962894
rdmaip_cleanup();
2897-
destroy_workqueue(rdmaip_wq);
28982895
return -ENOMEM;
28992896
}
29002897
rdmaip_init_flag |= RDMAIP_GARPS_WQ_CREATED;

0 commit comments

Comments
 (0)