Commit ba317e83 authored by Shay Drory's avatar Shay Drory Committed by Saeed Mahameed

net/mlx5: Destroy pool->mutex

Destroy pool->mutex when we destroy the pool.

Fixes: c36326d3 ("net/mlx5: Round-Robin EQs over IRQs")
Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
Reviewed-by: default avatarParav Pandit <parav@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 5957cc55
...@@ -440,6 +440,7 @@ irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name, ...@@ -440,6 +440,7 @@ irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name,
if (!pool) if (!pool)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
pool->dev = dev; pool->dev = dev;
mutex_init(&pool->lock);
xa_init_flags(&pool->irqs, XA_FLAGS_ALLOC); xa_init_flags(&pool->irqs, XA_FLAGS_ALLOC);
pool->xa_num_irqs.min = start; pool->xa_num_irqs.min = start;
pool->xa_num_irqs.max = start + size - 1; pool->xa_num_irqs.max = start + size - 1;
...@@ -448,7 +449,6 @@ irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name, ...@@ -448,7 +449,6 @@ irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name,
name); name);
pool->min_threshold = min_threshold * MLX5_EQ_REFS_PER_IRQ; pool->min_threshold = min_threshold * MLX5_EQ_REFS_PER_IRQ;
pool->max_threshold = max_threshold * MLX5_EQ_REFS_PER_IRQ; pool->max_threshold = max_threshold * MLX5_EQ_REFS_PER_IRQ;
mutex_init(&pool->lock);
mlx5_core_dbg(dev, "pool->name = %s, pool->size = %d, pool->start = %d", mlx5_core_dbg(dev, "pool->name = %s, pool->size = %d, pool->start = %d",
name, size, start); name, size, start);
return pool; return pool;
...@@ -462,6 +462,7 @@ static void irq_pool_free(struct mlx5_irq_pool *pool) ...@@ -462,6 +462,7 @@ static void irq_pool_free(struct mlx5_irq_pool *pool)
xa_for_each(&pool->irqs, index, irq) xa_for_each(&pool->irqs, index, irq)
irq_release(&irq->kref); irq_release(&irq->kref);
xa_destroy(&pool->irqs); xa_destroy(&pool->irqs);
mutex_destroy(&pool->lock);
kvfree(pool); kvfree(pool);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment