linux/drivers/infiniband
Dakshaja Uppalapati 2638a32348 RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs.
Previous atomic increment/decrement logic expects the atomic count to be
'0' after the final decrement.

Replacing atomic count with refcount does not allow that, as
refcount_dec() considers count of 1 as underflow and triggers a kernel
splat.

Fix the current refcount logic by using the usual pattern of decrementing
the refcount and test if it is '0' on the final deref in
c4iw_destroy_cq(). Use wait_for_completion() instead of wait_event().

Fixes: 7183451f84 ("RDMA/cxgb4: Use refcount_t instead of atomic_t for reference counting")
Link: https://lore.kernel.org/r/1628167412-12114-1-git-send-email-dakshaja@chelsio.com
Signed-off-by: Dakshaja Uppalapati <dakshaja@chelsio.com>
Reviewed-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-08-05 22:33:00 -03:00
..
core RDMA/cma: Revert INIT-INIT patch 2021-08-02 12:45:22 -03:00
hw RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs. 2021-08-05 22:33:00 -03:00
sw RDMA/rxe: Restore setting tot_len in the IPv4 header 2021-08-02 12:45:22 -03:00
ulp SCSI misc on 20210702 2021-07-02 15:14:36 -07:00
Kconfig RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00