summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2021-04-19 17:27:54 -0500
committerSuman Anna <s-anna@ti.com>2021-04-20 15:49:01 -0500
commit291847db87f20696a0922ba06d8bc1839d04ade0 (patch)
tree48f0b6ff27ccbc7366eb678740f33edc62820620
parent4057b6c07fd3d8dac3e220fed02cc893c9f8fce7 (diff)
downloadlinuxutils-291847db87f20696a0922ba06d8bc1839d04ade0.tar.gz
cmemk: Fix usage of get_user_pages_remote() on 5.9+ kernels
The get_user_pages_remote() function signature has changed in 5.9 kernel, it lost the first task_struct pointer argument [1]. Fix the current get_user_pages_remote() invocation in cmemk kernel with the appropriate signature to build properly for these kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=64019a2e467a288a16b65ab55ddcbf58c1b00187 Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r--src/cmem/module/cmemk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmem/module/cmemk.c b/src/cmem/module/cmemk.c
index 6295a9e..594a7d2 100644
--- a/src/cmem/module/cmemk.c
+++ b/src/cmem/module/cmemk.c
@@ -676,7 +676,10 @@ static phys_addr_t get_phys(void *virtp)
int res, nr_pages = 1;
struct page *pages;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0))
+ res = get_user_pages_remote(current->mm, virt, nr_pages,
+ FOLL_WRITE, &pages, NULL, NULL);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
res = get_user_pages_remote(current, current->mm, virt, nr_pages,
FOLL_WRITE, &pages, NULL, NULL);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))