aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2015-01-30 18:39:29 -0500
committerRoland Dreier <roland@purestorage.com>2015-01-30 18:39:29 -0500
commitc6a7ec7a0f3b7817ac1710c41fdeb84a3c33a47a (patch)
treec1413bed0e1f4ca7194a09e2bb3f2db33b7f4870 /drivers/infiniband
parente7a623d2df28a477efb6cf60471a4e2225e2e8e4 (diff)
Revert "IPoIB: Make the carrier_on_task race aware"
This reverts commit 67d7209e1f481cbaed37f9a224a328a3f83d0482. The series of IPoIB bug fixes that went into 3.19-rc1 introduce regressions, and after trying to sort things out, we decided to revert to 3.18's IPoIB driver and get things right for 3.20. Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 9862c76a83f7..eee66d13e5b9 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -353,27 +353,18 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
353 carrier_on_task); 353 carrier_on_task);
354 struct ib_port_attr attr; 354 struct ib_port_attr attr;
355 355
356 /*
357 * Take rtnl_lock to avoid racing with ipoib_stop() and
358 * turning the carrier back on while a device is being
359 * removed.
360 */
356 if (ib_query_port(priv->ca, priv->port, &attr) || 361 if (ib_query_port(priv->ca, priv->port, &attr) ||
357 attr.state != IB_PORT_ACTIVE) { 362 attr.state != IB_PORT_ACTIVE) {
358 ipoib_dbg(priv, "Keeping carrier off until IB port is active\n"); 363 ipoib_dbg(priv, "Keeping carrier off until IB port is active\n");
359 return; 364 return;
360 } 365 }
361 366
362 /* 367 rtnl_lock();
363 * Take rtnl_lock to avoid racing with ipoib_stop() and
364 * turning the carrier back on while a device is being
365 * removed. However, ipoib_stop() will attempt to flush
366 * the workqueue while holding the rtnl lock, so loop
367 * on trylock until either we get the lock or we see
368 * FLAG_ADMIN_UP go away as that signals that we are bailing
369 * and can safely ignore the carrier on work
370 */
371 while (!rtnl_trylock()) {
372 if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
373 return;
374 else
375 msleep(20);
376 }
377 if (!ipoib_cm_admin_enabled(priv->dev)) 368 if (!ipoib_cm_admin_enabled(priv->dev))
378 dev_set_mtu(priv->dev, min(priv->mcast_mtu, priv->admin_mtu)); 369 dev_set_mtu(priv->dev, min(priv->mcast_mtu, priv->admin_mtu));
379 netif_carrier_on(priv->dev); 370 netif_carrier_on(priv->dev);