FAILED: patch "[PATCH] IB/mlx5: Fix clean_mr() to work in the expected order" failed to apply to 4.9-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b9332dad987018745a0c0bb718d12dacfa760489 Mon Sep 17 00:00:00 2001
From: Yishai Hadas <[email protected]>
Date: Tue, 23 Jul 2019 09:57:28 +0300
Subject: [PATCH] IB/mlx5: Fix clean_mr() to work in the expected order
Any dma map underlying the MR should only be freed once the MR is fenced at the hardware.
As of the above we first destroy the MKEY and just after that can safely call to dma_unmap_single().
Cc <[email protected]> # 4.3
Fixes 8a187ee52b04 ("IB/mlx5: Support the new memory registration API")
Signed-off-by Yishai Hadas <[email protected]>
Reviewed-by Artemy Kovalyov <[email protected]>
Signed-off-by Leon Romanovsky <[email protected]>
Reviewed-by Jason Gunthorpe <[email protected]>
Signed-off-by Jason Gunthorpe <[email protected]>
drivers/infiniband/hw/mlx5/mr.c +3 -3
@@ -1582,10 +1582,10 @@ static void clean_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) mr->sig =NULL ; } -mlx5_free_priv_descs (mr); - -if (!allocated_from_cache) +if (!allocated_from_cache) {destroy_mkey (dev, mr); +mlx5_free_priv_descs (mr); + } }static void dereg_mr (struct mlx5_ib_dev *dev,struct mlx5_ib_mr *mr)