]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Fix clean_mr() to work in the expected order
authorYishai Hadas <yishaih@mellanox.com>
Tue, 23 Jul 2019 06:57:28 +0000 (09:57 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 24 Jul 2019 19:50:03 +0000 (16:50 -0300)
commita81a3483b63dd9e4b83b20ecb75ca784b145dafd
treeb26a02f21607b0e427af6743c8ece542b4d86fa6
parentdf91bba0914d12bd69f2f2929298fbec6db00c00
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().

Link: https://lore.kernel.org/r/20190723065733.4899-6-leon@kernel.org
Cc: <stable@vger.kernel.org> # 4.3
Fixes: be87469d3df0 ("IB/mlx5: Support the new memory registration API")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/mr.c