RDMA/cma: Remove unneeded locking for req paths
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 23 Jul 2020 07:07:06 +0000 (10:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 12:22:13 +0000 (14:22 +0200)
commitd4794085738d7912ec1fc6ebc9fabb20e07242f3
tree17b2aae4441bf53550bde05a1b72702463216ed4
parentc2064ac303312f5bb077d5e944f621d5b206d85e
RDMA/cma: Remove unneeded locking for req paths

[ Upstream commit cc9c037343898eb7a775e6b81d092ee21eeff218 ]

The REQ flows are concerned that once the handler is called on the new
cm_id the ULP can choose to trigger a rdma_destroy_id() concurrently at
any time.

However, this is not true, while the ULP can call rdma_destroy_id(), it
immediately blocks on the handler_mutex which prevents anything harmful
from running concurrently.

Remove the confusing extra locking and refcounts and make the
handler_mutex protecting state during destroy more clear.

Link: https://lore.kernel.org/r/20200723070707.1771101-4-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/cma.c