linux/drivers/infiniband/hw
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>
History 2021-08-05 22:33:00 -03:00
..
bnxt_re RDMA/bnxt_re: Fix stats counters 2021-07-12 14:42:27 -03:00
cxgb4 RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs. 2021-08-05 22:33:00 -03:00
efa RDMA: Split the alloc_hw_stats() ops to port and device variants 2021-06-16 20:58:29 -03:00
hfi1 Tracing updates for 5.14: 2021-07-03 11:13:22 -07:00
hns RDMA/hns: Fix the double unlock problem of poll_sem 2021-08-03 13:42:44 -03:00
irdma RDMA/irdma: Change returned type of irdma_setup_virt_qp to void 2021-07-15 15:14:11 -03:00
mlx4 Linux 5.13-rc7 2021-06-22 14:43:51 -03:00
mlx5 RDMA/mlx5: Delay emptying a cache entry when a new MR is added to it recently 2021-08-02 12:45:22 -03:00
mthca RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
ocrdma RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
qedr RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
qib RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
usnic RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
vmw_pvrdma RDMA: Remove rdma_set_device_sysfs_group() 2021-06-16 20:58:32 -03:00
Makefile RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00