[openib-general] [PATCH] ipoib: fix module removal race

Michael S. Tsirkin mst at mellanox.co.il
Sun Sep 11 08:19:34 PDT 2005


Roland, does the following patch make sense?
IP over IB seems more stable (didnt yet crash for me) with this applied.

---

Since ipoib uses queue_delayed_work to run flush task on port state events,
it must flush scheduled work after unregistering the event handler.

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

Index: linux-2.6.13/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- linux-2.6.13.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2005-09-11 12:36:47.000000000 +0300
+++ linux-2.6.13/drivers/infiniband/ulp/ipoib/ipoib_main.c	2005-09-11 14:13:49.000000000 +0300
@@ -1005,6 +1005,7 @@ debug_failed:
 
 register_failed:
 	ib_unregister_event_handler(&priv->event_handler);
+	flush_scheduled_work();
 
 event_failed:
 	ipoib_dev_cleanup(priv->dev);
@@ -1057,6 +1058,7 @@ static void ipoib_remove_one(struct ib_d
 
 	list_for_each_entry_safe(priv, tmp, dev_list, list) {
 		ib_unregister_event_handler(&priv->event_handler);
+		flush_scheduled_work();
 
 		unregister_netdev(priv->dev);
 		ipoib_dev_cleanup(priv->dev);

-- 
MST



More information about the general mailing list