From: Jason Gunthorpe Date: Mon, 28 Oct 2019 19:36:29 +0000 (-0300) Subject: Merge tag 'v5.4-rc5' into rdma.git for-next X-Git-Tag: v5.5-rc1~138^2~66 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=036313316d3a38bfde9ba49b3d00f73b7d8019d2;p=linux.git Merge tag 'v5.4-rc5' into rdma.git for-next Linux 5.4-rc5 For dependencies in the next patches Conflict resolved by keeping the delete of the unlock. Signed-off-by: Jason Gunthorpe --- 036313316d3a38bfde9ba49b3d00f73b7d8019d2 diff --cc drivers/infiniband/hw/mlx5/odp.c index 2ab6e44aeaae,3f9478d19376..b332117bca97 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@@ -282,10 -308,6 +312,9 @@@ void mlx5_ib_invalidate_range(struct ib idx - blk_start_idx + 1, 0, MLX5_IB_UPD_XLT_ZAP | MLX5_IB_UPD_XLT_ATOMIC); - mutex_unlock(&umem_odp->umem_mutex); + + mlx5_update_odp_stats(mr, invalidations, invalidations); + /* * We are now sure that the device will not access the * memory. We can safely unmap it, and mark it as dirty if @@@ -294,10 -316,10 +323,11 @@@ ib_umem_odp_unmap_dma_pages(umem_odp, start, end); + if (unlikely(!umem_odp->npages && mr->parent && !umem_odp->dying)) { - WRITE_ONCE(umem_odp->dying, 1); + WRITE_ONCE(mr->live, 0); + umem_odp->dying = 1; atomic_inc(&mr->parent->num_leaf_free); schedule_work(&umem_odp->work); } @@@ -542,9 -567,8 +573,10 @@@ struct mlx5_ib_mr *mlx5_ib_alloc_implic init_waitqueue_head(&imr->q_leaf_free); atomic_set(&imr->num_leaf_free, 0); atomic_set(&imr->num_pending_prefetch, 0); + smp_store_release(&imr->live, 1); + imr->is_odp_implicit = true; + return imr; }