summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2021-03-26 14:58:38 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-06 22:45:36 +0100
commit9d14d7d1c170c0f1c3ccf142b499ce85c24a252c (patch)
tree4b894a73826a8ea0eee317130a6ae0a106f09e99
parent0cf8cdb53af9ca646baefec1d3ed61ae4b9bce15 (diff)
downloadpoky-9d14d7d1c170c0f1c3ccf142b499ce85c24a252c.tar.gz
cryptodev-module: Backport a patch to fix build failure with kernel v5.8
Fix the following build failure with linux-yocto-dev zc.c:61:17: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_base'? 61 | down_read(&mm->mmap_sem); | ^~~~~~~~ | mmap_base zc.c:77:15: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_base'? 77 | up_read(&mm->mmap_sem); | ^~~~~~~~ | mmap_base (From OE-Core rev: fe668065ad7ec83aadfa36fe6ba1ced3db2e3cad) (From OE-Core rev: b132bdbca1980dd2f1e343372ae464f78fb337c2) Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-kernel/cryptodev/cryptodev-module_1.10.bb1
-rw-r--r--meta/recipes-kernel/cryptodev/files/0001-Fix-build-for-Linux-5.8-rc1.patch49
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-module_1.10.bb b/meta/recipes-kernel/cryptodev/cryptodev-module_1.10.bb
index 552eb6abaa..6474599c45 100644
--- a/meta/recipes-kernel/cryptodev/cryptodev-module_1.10.bb
+++ b/meta/recipes-kernel/cryptodev/cryptodev-module_1.10.bb
@@ -9,6 +9,7 @@ DEPENDS += "cryptodev-linux"
9 9
10SRC_URI += " \ 10SRC_URI += " \
11file://0001-Disable-installing-header-file-provided-by-another-p.patch \ 11file://0001-Disable-installing-header-file-provided-by-another-p.patch \
12file://0001-Fix-build-for-Linux-5.8-rc1.patch \
12" 13"
13 14
14EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"' 15EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Fix-build-for-Linux-5.8-rc1.patch b/meta/recipes-kernel/cryptodev/files/0001-Fix-build-for-Linux-5.8-rc1.patch
new file mode 100644
index 0000000000..02c721a4f3
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-Fix-build-for-Linux-5.8-rc1.patch
@@ -0,0 +1,49 @@
1From 9e765068582aae3696520346a7500322ca6cc2de Mon Sep 17 00:00:00 2001
2From: Joan Bruguera <joanbrugueram@gmail.com>
3Date: Sat, 13 Jun 2020 19:46:44 +0200
4Subject: [PATCH] Fix build for Linux 5.8-rc1
5
6See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9740ca4e95b43b91a4a848694a20d01ba6818f7b
7 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da1c55f1b272f4bd54671d459b39ea7b54944ef9
8 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d8ed45c5dcd455fc5848d47f86883a1b872ac0d0
9
10Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
11
12Upstream-Status: Backport [9e765068582aae3696520346a7500322ca6cc2de]
13
14Signed-off-by: He Zhe <zhe.he@windriver.com>
15---
16 zc.c | 8 ++++++++
17 1 file changed, 8 insertions(+)
18
19diff --git a/zc.c b/zc.c
20index ae464ff..2c286bb 100644
21--- a/zc.c
22+++ b/zc.c
23@@ -58,7 +58,11 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
24 return 0;
25 }
26
27+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
28 down_read(&mm->mmap_sem);
29+#else
30+ mmap_read_lock(mm);
31+#endif
32 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0))
33 ret = get_user_pages(task, mm,
34 (unsigned long)addr, pgcount, write, 0, pg, NULL);
35@@ -74,7 +78,11 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
36 (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
37 pg, NULL, NULL);
38 #endif
39+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
40 up_read(&mm->mmap_sem);
41+#else
42+ mmap_read_unlock(mm);
43+#endif
44 if (ret != pgcount)
45 return -EINVAL;
46
47--
482.17.1
49