From: Maxim Mikityanskiy Date: Fri, 23 Apr 2021 16:14:37 +0000 (+0300) Subject: net/mlx5: Take TIR destruction out of the TIR list lock X-Git-Tag: iomap-folio-5.17-old~723^2~391^2~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=69994ef3da660af4ff22c740f85dc291a50a6440;p=users%2Fwilly%2Flinux.git net/mlx5: Take TIR destruction out of the TIR list lock res->td.list_lock protects the list of TIRs. There is no point to call mlx5_core_destroy_tir() and invoke a firmware command under this lock. This commit moves this call outside of the lock and puts it after deleting the TIR from the list to ensure that TIRs are always alive while in the list. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c index 8c166ee56d8b..f3bdd063051a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c @@ -58,9 +58,10 @@ void mlx5e_destroy_tir(struct mlx5_core_dev *mdev, struct mlx5e_hw_objs *res = &mdev->mlx5e_res.hw_objs; mutex_lock(&res->td.list_lock); - mlx5_core_destroy_tir(mdev, tir->tirn); list_del(&tir->list); mutex_unlock(&res->td.list_lock); + + mlx5_core_destroy_tir(mdev, tir->tirn); } void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc)