Message ID | 2039c22cfc3df02378747ba4d623a558b53fc263.1738587076.git.leon@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [rdma-rc] RDMA/mlx5: Fix a WARN during dereg_mr for DM type | expand |
On Mon, 03 Feb 2025 14:51:43 +0200, Leon Romanovsky wrote: > Memory regions (MR) of type DM (device memory) do not have an associated > umem. > > In the __mlx5_ib_dereg_mr() -> mlx5_free_priv_descs() flow, the code > incorrectly takes the wrong branch, attempting to call > dma_unmap_single() on a DMA address that is not mapped. > > [...] Applied, thanks! [1/1] RDMA/mlx5: Fix a WARN during dereg_mr for DM type https://git.kernel.org/rdma/rdma/c/abc7b3f1f056d6 Best regards,
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 32ab489517f6..28c93eb59ba7 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -2001,7 +2001,8 @@ mlx5_alloc_priv_descs(struct ib_device *device, static void mlx5_free_priv_descs(struct mlx5_ib_mr *mr) { - if (!mr->umem && !mr->data_direct && mr->descs) { + if (!mr->umem && !mr->data_direct && + mr->ibmr.type != IB_MR_TYPE_DM && mr->descs) { struct ib_device *device = mr->ibmr.device; int size = mr->max_descs * mr->desc_size; struct mlx5_ib_dev *dev = to_mdev(device);