OSDN Git Service

i40iw: Reorganize acquire/release of locks in i40iw_manage_apbvt
authorShiraz Saleem <shiraz.saleem@intel.com>
Fri, 1 Jun 2018 17:18:36 +0000 (12:18 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 18 Jun 2018 17:09:05 +0000 (11:09 -0600)
commitaaf5e003b1c454c5722bc4ea9dfd3506c57d36a9
treed19d688c6cf8aa98ce21abaa0ae18d700ee8cfee
parentde7498147d0053273fd3dcf85ba20babb9ef9725
i40iw: Reorganize acquire/release of locks in i40iw_manage_apbvt

Commit f43c00c04bbf ("i40iw: Extend port reuse support for listeners")
introduces a sparse warning:

include/linux/spinlock.h:365:9: sparse: context imbalance in
'i40iw_manage_apbvt' - unexpected unlock

Fix this by reorganizing the acquire/release of locks in
i40iw_manage_apbvt and add a new function i40iw_cqp_manage_abvpt_cmd
to perform the CQP command. Also, use __clear_bit and __test_and_set_bit
as we do not need atomic versions.

Fixes: f43c00c04bbf ("i40iw: Extend port reuse support for listeners")
Suggested-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_hw.c