forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/drivers/misc/cxl/cxllib.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2017 IBM Corp.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 */
95
106 #include <linux/hugetlb.h>
....@@ -211,7 +207,7 @@
211207 struct vm_area_struct *vma = NULL;
212208 int rc = 0;
213209
214
- down_read(&mm->mmap_sem);
210
+ mmap_read_lock(mm);
215211
216212 vma = find_vma(mm, addr);
217213 if (!vma) {
....@@ -222,7 +218,7 @@
222218 *vma_start = vma->vm_start;
223219 *vma_end = vma->vm_end;
224220 out:
225
- up_read(&mm->mmap_sem);
221
+ mmap_read_unlock(mm);
226222 return rc;
227223 }
228224
....@@ -249,9 +245,8 @@
249245 dar += page_size) {
250246 if (dar < vma_start || dar >= vma_end) {
251247 /*
252
- * We don't hold the mm->mmap_sem semaphore
253
- * while iterating, since the semaphore is
254
- * required by one of the lower-level page
248
+ * We don't hold mm->mmap_lock while iterating, since
249
+ * the lock is required by one of the lower-level page
255250 * fault processing functions and it could
256251 * create a deadlock.
257252 *