]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/core: Fix ordering of CQ pool destruction
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 14 Sep 2020 18:20:18 +0000 (15:20 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:29 +0000 (17:36 +0200)
commit38c2ce54364738b7b3aa0fdbaf588635712bc942
tree304868f7a78122077ee07e45dcc0e9745407ca34
parent9003be1fb4d099d6b37f7dd20e7cc15b00755a1e
RDMA/core: Fix ordering of CQ pool destruction

[ Upstream commit 4aa1615268a8ac2b20096211d3f9ac53874067d7 ]

rxe will hold a refcount on the IB device as long as CQ objects exist,
this causes destruction of a rxe device to hang if the CQ pool has any
cached CQs since they are being destroyed after the refcount must go to
zero.

Treat the CQ pool like a client and create/destroy it before/after all
other clients. No users of CQ pool can exist past a client remove call.

Link: https://lore.kernel.org/r/e8a240aa-9e9b-3dca-062f-9130b787f29b@acm.org
Fixes: c7ff819aefea ("RDMA/core: Introduce shared CQ pool API")
Tested-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/device.c