[PATCH] IPoIB: Fix device removal race
authorMichael S. Tsirkin <mst@mellanox.co.il>
Wed, 24 Aug 2005 21:41:51 +0000 (14:41 -0700)
committerRoland Dreier <rolandd@cisco.com>
Sat, 27 Aug 2005 03:37:38 +0000 (20:37 -0700)
Currently we may have work scheduled in default kernel workqueue when
the device is going down.  The device could get freed before this
workqueue gets serviced.  I am actually seeing this causing system
hangs.

The following patch fixes this by using ipoib_workqueue which gets
flushed when the device is going down.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 57c3ac98991f6942a148b9d328b1cd065bc3bf60..0e8ac138e355bd4c71e2c21f58a809eb7d0f190e 100644 (file)
@@ -672,7 +672,7 @@ static void ipoib_set_mcast_list(struct net_device *dev)
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
 
-       schedule_work(&priv->restart_task);
+       queue_work(ipoib_workqueue, &priv->restart_task);
 }
 
 static void ipoib_neigh_destructor(struct neighbour *n)