diff options
author | Moni Shoua <monis@mellanox.co.il> | 2014-02-05 08:12:59 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-02-13 17:31:08 -0500 |
commit | 4ce5a5744a2f5479e58c6788cbe3987b8071b62e (patch) | |
tree | 0961920538c9cfd956e2c62ff408f78bfa14738f /drivers/infiniband/hw/mlx4 | |
parent | acc4fccf4eff5b29e545995b75de77e60ea44aae (diff) |
IB/mlx4: Move rtnl locking to the right place
On the one hand, the invocation of netdev_master_upper_dev_get()
within mlx4_ib_scan_netdevs() must be done with rtnl lock held. On
the other hand, it's wrong to call rtnl_lock() from within this
function since it's also called by our netdev notifier callback.
Therefore move the locking to mlx4_ib_add() so that both cases are
covered.
Signed-off-by: Moni Shoua <monis@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index b99d0ecc6a89..93f492f62997 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1707,10 +1707,8 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev) | |||
1707 | iboe->netdevs[port - 1], port); | 1707 | iboe->netdevs[port - 1], port); |
1708 | if (iboe->netdevs[port - 1] && | 1708 | if (iboe->netdevs[port - 1] && |
1709 | netif_is_bond_slave(iboe->netdevs[port - 1])) { | 1709 | netif_is_bond_slave(iboe->netdevs[port - 1])) { |
1710 | rtnl_lock(); | ||
1711 | iboe->masters[port - 1] = netdev_master_upper_dev_get( | 1710 | iboe->masters[port - 1] = netdev_master_upper_dev_get( |
1712 | iboe->netdevs[port - 1]); | 1711 | iboe->netdevs[port - 1]); |
1713 | rtnl_unlock(); | ||
1714 | } | 1712 | } |
1715 | curr_master = iboe->masters[port - 1]; | 1713 | curr_master = iboe->masters[port - 1]; |
1716 | 1714 | ||
@@ -2100,7 +2098,9 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
2100 | } | 2098 | } |
2101 | } | 2099 | } |
2102 | #endif | 2100 | #endif |
2101 | rtnl_lock(); | ||
2103 | mlx4_ib_scan_netdevs(ibdev); | 2102 | mlx4_ib_scan_netdevs(ibdev); |
2103 | rtnl_unlock(); | ||
2104 | mlx4_ib_init_gid_table(ibdev); | 2104 | mlx4_ib_init_gid_table(ibdev); |
2105 | } | 2105 | } |
2106 | 2106 | ||