Skip to content

Commit

Permalink
mlx4: protect mlx4_en_start_port in mlx4_en_restart with rtnl_lock
Browse files Browse the repository at this point in the history
mlx4_en_start_port requires rtnl_lock to be held.

Cc: Eugenia Emantayev <eugenia@mellanox.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hannes Frederic Sowa authored and David S. Miller committed Apr 21, 2016
1 parent 41419b9 commit 0c5c325
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx4/en_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,13 +1856,15 @@ static void mlx4_en_restart(struct work_struct *work)

en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port);

rtnl_lock();
mutex_lock(&mdev->state_lock);
if (priv->port_up) {
mlx4_en_stop_port(dev, 1);
if (mlx4_en_start_port(dev))
en_err(priv, "Failed restarting port %d\n", priv->port);
}
mutex_unlock(&mdev->state_lock);
rtnl_unlock();
}

static void mlx4_en_clear_stats(struct net_device *dev)
Expand Down

0 comments on commit 0c5c325

Please sign in to comment.