aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/user_mad.c
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2018-01-08 12:15:37 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-01-10 22:00:32 -0700
commit008b656f429824a1987f28150d66eaf8f26d58a1 (patch)
tree366898e8ad37ab68bb740e40dda6adf919624ab2 /drivers/infiniband/core/user_mad.c
parentRDMA/rxe: Fix a race condition related to the QP error state (diff)
downloadlinux-dev-008b656f429824a1987f28150d66eaf8f26d58a1.tar.xz
linux-dev-008b656f429824a1987f28150d66eaf8f26d58a1.zip
IB/core: Remove the locking for character device bitmaps
Remove the locks that protect character device bitmaps of uverbs, umad and issm. The character device bitmaps are accessed in "client->add" and "client->remove" calls from ib_register_device and ib_unregister_device respectively. These calls are already protected by the "device_mutex" mutex. Thus, the spinlocks are not needed. Signed-off-by: Huy Nguyen <huyn@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/user_mad.c')
-rw-r--r--drivers/infiniband/core/user_mad.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index d4de187b1064..608176e9cd5d 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -129,7 +129,6 @@ static struct class *umad_class;
static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE);
-static DEFINE_SPINLOCK(port_lock);
static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS);
static void ib_umad_add_one(struct ib_device *device);
@@ -1172,15 +1171,12 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
int devnum;
dev_t base;
- spin_lock(&port_lock);
devnum = find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS);
if (devnum >= IB_UMAD_MAX_PORTS) {
- spin_unlock(&port_lock);
devnum = find_overflow_devnum(device);
if (devnum < 0)
return -1;
- spin_lock(&port_lock);
port->dev_num = devnum + IB_UMAD_MAX_PORTS;
base = devnum + overflow_maj;
set_bit(devnum, overflow_map);
@@ -1189,7 +1185,6 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
base = devnum + base_dev;
set_bit(devnum, dev_map);
}
- spin_unlock(&port_lock);
port->ib_dev = device;
port->port_num = port_num;