diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2021-09-13 11:04:42 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-09-24 10:55:28 -0300 |
commit | a86cd017a40a66b1a3db005bfee4e76a1ae9a432 (patch) | |
tree | e2497ffb32b0e96b4d5a6b0c6e56db16936f32d1 /drivers/infiniband/hw/usnic/usnic_ib.h | |
parent | 14351f08ed5c8b888cdd95651152db7e096ee27f (diff) | |
download | linux-a86cd017a40a66b1a3db005bfee4e76a1ae9a432.tar.gz linux-a86cd017a40a66b1a3db005bfee4e76a1ae9a432.tar.bz2 linux-a86cd017a40a66b1a3db005bfee4e76a1ae9a432.zip |
RDMA/usnic: Lock VF with mutex instead of spinlock
Usnic VF doesn't need lock in atomic context to create QPs, so it is safe
to use mutex instead of spinlock. Such change fixes the following smatch
error.
Smatch static checker warning:
lib/kobject.c:289 kobject_set_name_vargs()
warn: sleeping in atomic context
Fixes: 514aee660df4 ("RDMA: Globally allocate and release QP memory")
Link: https://lore.kernel.org/r/2a0e295786c127e518ebee8bb7cafcb819a625f6.1631520231.git.leonro@nvidia.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/usnic/usnic_ib.h')
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_ib.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib.h b/drivers/infiniband/hw/usnic/usnic_ib.h index 84dd682d2334..b350081aeb5a 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib.h +++ b/drivers/infiniband/hw/usnic/usnic_ib.h @@ -90,7 +90,7 @@ struct usnic_ib_dev { struct usnic_ib_vf { struct usnic_ib_dev *pf; - spinlock_t lock; + struct mutex lock; struct usnic_vnic *vnic; unsigned int qp_grp_ref_cnt; struct usnic_ib_pd *pd; |