From: Michael S. Tsirkin Date: Wed, 24 Aug 2005 21:41:51 +0000 (-0700) Subject: [PATCH] IPoIB: Fix device removal race X-Git-Tag: v2.6.14-rc1~1050^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1ad62a19f177e61d4dde111ba35fb4badd0c2106;p=linux-2.6-omap-h63xx.git [PATCH] IPoIB: Fix device removal race 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 Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 57c3ac98991..0e8ac138e35 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -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)