RDMA/mlx4: Remove bogus dev_base_lock usage
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 8 Dec 2020 19:39:28 +0000 (21:39 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 10 Dec 2020 20:58:25 +0000 (16:58 -0400)
It is not clear what this lock protects. If the authors wanted to ensure
that "dev" does not disappear, that is impossible, given the following
code path:

mlx4_ib_netdev_event (under RTNL mutex)
-> mlx4_ib_scan_netdevs
   -> mlx4_ib_update_qps

Also, the dev_base_lock does not protect dev->dev_addr either.

So it serves no purpose here. Remove it.

Link: https://lore.kernel.org/r/20201208193928.1500893-1-vladimir.oltean@nxp.com
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx4/main.c

index f0864f40ea1ac0802a8ebeec284bdc705f9c49ac..e3cd402c079afcff98e0951a1482c51088623cfc 100644 (file)
@@ -2265,10 +2265,7 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
        u64 release_mac = MLX4_IB_INVALID_MAC;
        struct mlx4_ib_qp *qp;
 
-       read_lock(&dev_base_lock);
        new_smac = mlx4_mac_to_u64(dev->dev_addr);
-       read_unlock(&dev_base_lock);
-
        atomic64_set(&ibdev->iboe.mac[port - 1], new_smac);
 
        /* no need for update QP1 and mac registration in non-SRIOV */