From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/infiniband/hw/mlx5/mlx5_ib.h

Change-Id: If385cc6e3ca1e4c8ecbd11dd4422841c33a69f8f
---
 drivers/infiniband/hw/mlx5/mlx5_ib.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -657,7 +657,7 @@ struct mlx5_ib_mkey {
 	u32 key;
 	enum mlx5_mkey_type type;
 	unsigned int ndescs;
-	struct wait_queue_head wait;
+	wait_queue_head_t wait;
 	refcount_t usecount;
 };
 
@@ -1284,7 +1284,8 @@ to_mmmap(struct rdma_user_mmap_entry *rd
 		struct mlx5_user_mmap_entry, rdma_entry);
 }
 
-int mlx5_ib_db_map_user(struct mlx5_ib_ucontext *context, unsigned long virt,
+int mlx5_ib_db_map_user(struct mlx5_ib_ucontext *context,
+			struct ib_udata *udata, unsigned long virt,
 			struct mlx5_db *db);
 void mlx5_ib_db_unmap_user(struct mlx5_ib_ucontext *context, struct mlx5_db *db);
 void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq);
@@ -1349,6 +1350,7 @@ int mlx5_ib_update_xlt(struct mlx5_ib_mr
 		       int page_shift, int flags);
 int mlx5_ib_update_mr_pas(struct mlx5_ib_mr *mr, unsigned int flags);
 struct mlx5_ib_mr *mlx5_ib_alloc_implicit_mr(struct mlx5_ib_pd *pd,
+			    		     struct ib_udata *udata,
 					     int access_flags);
 void mlx5_ib_free_implicit_mr(struct mlx5_ib_mr *mr);
 void mlx5_ib_free_odp_mr(struct mlx5_ib_mr *mr);
@@ -1423,6 +1425,10 @@ int mlx5r_odp_create_eq(struct mlx5_ib_d
 void mlx5_ib_odp_cleanup_one(struct mlx5_ib_dev *ibdev);
 int __init mlx5_ib_odp_init(void);
 void mlx5_ib_odp_cleanup(void);
+#ifndef HAVE_MMU_INTERVAL_NOTIFIER
+void mlx5_ib_invalidate_range(struct ib_umem_odp *umem_odp, unsigned long start,
+			      unsigned long end);
+#endif
 void mlx5_odp_init_mr_cache_entry(struct mlx5_cache_ent *ent);
 void mlx5_odp_populate_xlt(void *xlt, size_t idx, size_t nentries,
 			   struct mlx5_ib_mr *mr, int flags);
@@ -1461,10 +1467,17 @@ static inline int mlx5_ib_init_dmabuf_mr
 {
 	return -EOPNOTSUPP;
 }
+#ifndef HAVE_MMU_INTERVAL_NOTIFIER
+static inline void mlx5_ib_invalidate_range(struct ib_umem_odp *umem_odp,
+					    unsigned long start,
+					    unsigned long end){};
+#endif
 #endif /* CONFIG_INFINIBAND_ON_DEMAND_PAGING */
 
+#ifdef HAVE_MMU_INTERVAL_NOTIFIER
 extern const struct mmu_interval_notifier_ops mlx5_mn_ops;
 
+#endif
 /* Needed for rep profile */
 void __mlx5_ib_remove(struct mlx5_ib_dev *dev,
 		      const struct mlx5_ib_profile *profile,
