cryptodev: Fix changed mm interface in Kernel 4.9

The memory management interface has changed in Kernel 4.9.

This patch adds a patch which fixes the paramter of the function call.

Backport from https://github.com/cryptodev-linux/cryptodev-linux
Based on commit f126e4837e6334d0464540995df7426fedf6b175

(From OE-Core rev: 29e3e2999ae0fd92fd41c2180359e110301a488c)

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Daniel Schultz 2017-01-26 14:44:56 +01:00 committed by Richard Purdie
parent 710a6e6bdc
commit d053ce3071
2 changed files with 42 additions and 1 deletions

View File

@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "http://download.gna.org/cryptodev-linux/cryptodev-linux-${PV}.tar.gz \
file://06d6b560c6e45dc317dae47c74706fa43f4a31d8.patch \
file://cb186f682679383e8b5806240927903730ce85d9.patch"
file://cb186f682679383e8b5806240927903730ce85d9.patch \
file://0001-Adjust-to-another-change-in-the-user-page-API.patch"
SRC_URI[md5sum] = "02644cc4cd02301e0b503a332eb2f0b5"
SRC_URI[sha256sum] = "67fabde9fb67b286a96c4f45b594b0eccd0f761b495705c18f2ae9461b831376"

View File

@ -0,0 +1,40 @@
From f126e4837e6334d0464540995df7426fedf6b175 Mon Sep 17 00:00:00 2001
From: Michael Weiser <michael.weiser@gmx.de>
Date: Fri, 11 Nov 2016 18:09:32 +0100
Subject: [PATCH] Adjust to another change in the user page API
4.9.0 will replace the write and force flags of get_user_pages_remote()
with a gup_flags parameter[1]. Distinguish the two APIs based on kernel
version we're compiling for.
[1] https://github.com/torvalds/linux/commit/9beae1ea89305a9667ceaab6d0bf46a045ad71e7
Upstream-Status: Backport
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
zc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/zc.c b/zc.c
index a97b49f..e766ee3 100644
--- a/zc.c
+++ b/zc.c
@@ -65,7 +65,13 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
ret = get_user_pages(
#endif
task, mm,
- (unsigned long)addr, pgcount, write, 0, pg, NULL);
+ (unsigned long)addr, pgcount,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
+ write ? FOLL_WRITE : 0,
+#else
+ write, 0,
+#endif
+ pg, NULL);
up_read(&mm->mmap_sem);
if (ret != pgcount)
return -EINVAL;
--
1.9.1