IB/core: Shifting initialization of device->cache_lock
The lock cache_lock of struct ib_device is initialized in function ib_cache_setup_one(). This is much later than the device initialization in _ib_alloc_device(). This change shifts initialization of cache_lock in _ib_alloc_device(). Link: https://lore.kernel.org/r/20210712122625.1147-3-anand.a.khoje@oracle.com Suggested-by: Haakon Bugge <haakon.bugge@oracle.com> Signed-off-by: Anand Khoje <anand.a.khoje@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
0bc0602ae8
commit
36721a6d4c
|
@ -1621,8 +1621,6 @@ int ib_cache_setup_one(struct ib_device *device)
|
||||||
u32 p;
|
u32 p;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
rwlock_init(&device->cache_lock);
|
|
||||||
|
|
||||||
err = gid_table_setup_one(device);
|
err = gid_table_setup_one(device);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -607,6 +607,8 @@ struct ib_device *_ib_alloc_device(size_t size)
|
||||||
for (i = 0; i < ARRAY_SIZE(device->cq_pools); i++)
|
for (i = 0; i < ARRAY_SIZE(device->cq_pools); i++)
|
||||||
INIT_LIST_HEAD(&device->cq_pools[i]);
|
INIT_LIST_HEAD(&device->cq_pools[i]);
|
||||||
|
|
||||||
|
rwlock_init(&device->cache_lock);
|
||||||
|
|
||||||
device->uverbs_cmd_mask =
|
device->uverbs_cmd_mask =
|
||||||
BIT_ULL(IB_USER_VERBS_CMD_ALLOC_MW) |
|
BIT_ULL(IB_USER_VERBS_CMD_ALLOC_MW) |
|
||||||
BIT_ULL(IB_USER_VERBS_CMD_ALLOC_PD) |
|
BIT_ULL(IB_USER_VERBS_CMD_ALLOC_PD) |
|
||||||
|
|
Loading…
Reference in New Issue