[openib-general] [PATCH 2 of 2] fix module unloading races

Michael S. Tsirkin mst at mellanox.co.il
Fri Apr 21 00:38:01 PDT 2006


Please review.

---

Make sure that callbacks have completed before allowing the module
text to go away.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: openib/drivers/infiniband/core/cma.c
===================================================================
--- openib.orig/drivers/infiniband/core/cma.c	2006-04-21 09:23:22.000000000 +0300
+++ openib/drivers/infiniband/core/cma.c	2006-04-21 10:04:53.000000000 +0300
@@ -1791,6 +1791,7 @@ static void cma_remove_one(struct ib_dev
 
 	cma_process_remove(cma_dev);
 	kfree(cma_dev);
+	ib_sa_flush(device);
 }
 
 static int cma_init(void)
@@ -1817,6 +1818,7 @@ static void cma_cleanup(void)
 	destroy_workqueue(cma_wq);
 	idr_destroy(&sdp_ps);
 	idr_destroy(&tcp_ps);
+	rdma_addr_flush();
 }
 
 module_init(cma_init);
Index: openib/drivers/infiniband/core/multicast.c
===================================================================
--- openib.orig/drivers/infiniband/core/multicast.c	2006-04-21 09:23:22.000000000 +0300
+++ openib/drivers/infiniband/core/multicast.c	2006-04-21 10:03:41.000000000 +0300
@@ -649,6 +649,7 @@ static void mcast_remove_one(struct ib_d
 	}
 
 	kfree(dev);
+	ib_sa_flush(device);
 }
 
 static int __init mcast_init(void)
Index: openib/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- openib.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-04-21 09:23:19.000000000 +0300
+++ openib/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-04-21 10:07:08.000000000 +0300
@@ -1174,6 +1174,7 @@ static void ipoib_remove_one(struct ib_d
 	}
 
 	kfree(dev_list);
+	ib_sa_flush(device);
 }
 
 static int __init ipoib_init_module(void)
Index: openib/drivers/infiniband/ulp/srp/ib_srp.c
===================================================================
--- openib.orig/drivers/infiniband/ulp/srp/ib_srp.c	2006-04-21 09:23:19.000000000 +0300
+++ openib/drivers/infiniband/ulp/srp/ib_srp.c	2006-04-21 10:07:03.000000000 +0300
@@ -1748,6 +1748,7 @@ static void srp_remove_one(struct ib_dev
 	}
 
 	kfree(dev_list);
+	ib_sa_flush(device);
 }
 
 static int __init srp_init_module(void)

-- 
MST

----- End forwarded message -----

-- 
MST



More information about the general mailing list