summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2017-10-10 10:36:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:07:33 +0100
commit2eb165b9fbb722416252c054ac2ef2c3eb777460 (patch)
treef71a58cb2f9f29bc732df0370fec84b826a94b69
parent0c70b35bf1583fa5fc9134b87d32cf0bc27d5023 (diff)
downloadlinux-stable-2eb165b9fbb722416252c054ac2ef2c3eb777460.tar.gz
linux-stable-2eb165b9fbb722416252c054ac2ef2c3eb777460.tar.bz2
linux-stable-2eb165b9fbb722416252c054ac2ef2c3eb777460.zip
IB/ipoib: Grab rtnl lock on heavy flush when calling ndo_open/stop
[ Upstream commit b4b678b06f6eef18bff44a338c01870234db0bc9 ] When ndo_open and ndo_stop are called RTNL lock should be held. In this specific case ipoib_ib_dev_open calls the offloaded ndo_open which re-sets the number of TX queue assuming RTNL lock is held. Since RTNL lock is not held, RTNL assert will fail. Signed-off-by: Alex Vesker <valex@mellanox.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 830fecb6934c..335bd2c9e16e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -1177,10 +1177,15 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,
ipoib_ib_dev_down(dev);
if (level == IPOIB_FLUSH_HEAVY) {
+ rtnl_lock();
if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags))
ipoib_ib_dev_stop(dev);
- if (ipoib_ib_dev_open(dev) != 0)
+
+ result = ipoib_ib_dev_open(dev);
+ rtnl_unlock();
+ if (result)
return;
+
if (netif_queue_stopped(dev))
netif_start_queue(dev);
}