forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/infiniband/hw/hfi1/user_exp_rcv.h
....@@ -1,6 +1,7 @@
11 #ifndef _HFI1_USER_EXP_RCV_H
22 #define _HFI1_USER_EXP_RCV_H
33 /*
4
+ * Copyright(c) 2020 - Cornelis Networks, Inc.
45 * Copyright(c) 2015 - 2017 Intel Corporation.
56 *
67 * This file is provided under a dual BSD/GPLv2 license. When using or
....@@ -48,7 +49,6 @@
4849 */
4950
5051 #include "hfi.h"
51
-
5252 #include "exp_rcv.h"
5353
5454 struct tid_pageset {
....@@ -57,6 +57,8 @@
5757 };
5858
5959 struct tid_user_buf {
60
+ struct mmu_interval_notifier notifier;
61
+ struct mutex cover_mutex;
6062 unsigned long vaddr;
6163 unsigned long length;
6264 unsigned int npages;
....@@ -66,14 +68,16 @@
6668 };
6769
6870 struct tid_rb_node {
69
- struct mmu_rb_node mmu;
71
+ struct mmu_interval_notifier notifier;
72
+ struct hfi1_filedata *fdata;
73
+ struct mutex invalidate_mutex; /* covers hw removal */
7074 unsigned long phys;
7175 struct tid_group *grp;
7276 u32 rcventry;
7377 dma_addr_t dma_addr;
7478 bool freed;
7579 unsigned int npages;
76
- struct page *pages[0];
80
+ struct page *pages[];
7781 };
7882
7983 static inline int num_user_pages(unsigned long addr,
....@@ -95,4 +99,9 @@
9599 int hfi1_user_exp_rcv_invalid(struct hfi1_filedata *fd,
96100 struct hfi1_tid_info *tinfo);
97101
102
+static inline struct mm_struct *mm_from_tid_node(struct tid_rb_node *node)
103
+{
104
+ return node->notifier.mm;
105
+}
106
+
98107 #endif /* _HFI1_USER_EXP_RCV_H */