@@ -347,9 +347,6 @@ void *rxe_alloc__(struct rxe_pool *pool)
kref_get(&pool->ref_cnt);
- if (!ib_device_try_get(&pool->rxe->ib_dev))
- goto out_put_pool;
-
if (atomic_inc_return(&pool->num_elem) > pool->max_elem)
goto out_cnt;
@@ -366,7 +363,6 @@ void *rxe_alloc__(struct rxe_pool *pool)
out_cnt:
atomic_dec(&pool->num_elem);
- ib_device_put(&pool->rxe->ib_dev);
out_put_pool:
rxe_pool_put(pool);
return NULL;
@@ -388,9 +384,6 @@ void *rxe_alloc(struct rxe_pool *pool)
kref_get(&pool->ref_cnt);
read_unlock_irqrestore(&pool->pool_lock, flags);
- if (!ib_device_try_get(&pool->rxe->ib_dev))
- goto out_put_pool;
-
if (atomic_inc_return(&pool->num_elem) > pool->max_elem)
goto out_cnt;
@@ -407,7 +400,6 @@ void *rxe_alloc(struct rxe_pool *pool)
out_cnt:
atomic_dec(&pool->num_elem);
- ib_device_put(&pool->rxe->ib_dev);
out_put_pool:
rxe_pool_put(pool);
return NULL;
@@ -425,9 +417,6 @@ int __rxe_add_to_pool(struct rxe_pool *pool, struct rxe_pool_entry *elem)
kref_get(&pool->ref_cnt);
read_unlock_irqrestore(&pool->pool_lock, flags);
- if (!ib_device_try_get(&pool->rxe->ib_dev))
- goto out_put_pool;
-
if (atomic_inc_return(&pool->num_elem) > pool->max_elem)
goto out_cnt;
@@ -438,7 +427,6 @@ int __rxe_add_to_pool(struct rxe_pool *pool, struct rxe_pool_entry *elem)
out_cnt:
atomic_dec(&pool->num_elem);
- ib_device_put(&pool->rxe->ib_dev);
out_put_pool:
rxe_pool_put(pool);
return -EINVAL;
@@ -461,7 +449,6 @@ void rxe_elem_release(struct kref *kref)
}
atomic_dec(&pool->num_elem);
- ib_device_put(&pool->rxe->ib_dev);
rxe_pool_put(pool);
}
rxe_pool.c had redundant attempts to reference count rxe objects taking references to the pools and also the ib_device. This patch eliminates the references to the ib_device which add no value. Signed-off-by: Bob Pearson <rpearson@hpe.com> --- drivers/infiniband/sw/rxe/rxe_pool.c | 13 ------------- 1 file changed, 13 deletions(-)