]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / drivers / infiniband / ulp / ipoib / ipoib_multicast.c
index 1fcc9a898d81c8fefd4ceb852926221fb3261da8..ac33c8f3ea8580e5120dd98704cfbccb0ccd5c71 100644 (file)
@@ -392,8 +392,16 @@ static int ipoib_mcast_join_complete(int status,
                                           &priv->mcast_task, 0);
                mutex_unlock(&mcast_mutex);
 
-               if (mcast == priv->broadcast)
+               if (mcast == priv->broadcast) {
+                       /*
+                        * Take RTNL lock here to avoid racing with
+                        * ipoib_stop() and turning the carrier back
+                        * on while a device is being removed.
+                        */
+                       rtnl_lock();
                        netif_carrier_on(dev);
+                       rtnl_unlock();
+               }
 
                return 0;
        }
@@ -769,7 +777,7 @@ void ipoib_mcast_restart_task(struct work_struct *work)
        ipoib_mcast_stop_thread(dev, 0);
 
        local_irq_save(flags);
-       netif_tx_lock(dev);
+       netif_addr_lock(dev);
        spin_lock(&priv->lock);
 
        /*
@@ -846,7 +854,7 @@ void ipoib_mcast_restart_task(struct work_struct *work)
        }
 
        spin_unlock(&priv->lock);
-       netif_tx_unlock(dev);
+       netif_addr_unlock(dev);
        local_irq_restore(flags);
 
        /* We have to cancel outside of the spinlock */