mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <oss-lists@triops.cz>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1
Date: Sun, 22 Feb 2026 16:18:19 +0100	[thread overview]
Message-ID: <aZseOz6OvD4jmTQw@lenoch> (raw)
In-Reply-To: <aZseChqY58Wcw65n@lenoch>

From: Ladislav Michl <ladis@triops.cz>

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 .../0004-Fix-build-for-Linux-6.18-rc1.patch   | 50 +++++++++++++++++++
 patches/cryptodev-linux-1.14/series           |  3 +-
 2 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch

diff --git a/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
new file mode 100644
index 000000000..879f755e5
--- /dev/null
+++ b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
@@ -0,0 +1,50 @@
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 6 Sep 2025 20:36:38 +0000
+Subject: [PATCH] Fix build for Linux 6.18-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's no longer required to use nth_page() when iterating pages within a
+single scatterlist entry.
+
+Note I believe this code path in `sg_advance` is currently unreachable:
+It is only called from `get_userbuf_srtp`, passing in a scatterlist
+copied from one created by `__get_userbuf`, which only generates
+entries such that `sg->offset + sg->length <= PAGE_SIZE`.
+On the other hand, this code path in `sg_advance` requires that
+`sg->offset + sg->length > sg->offset + consumed >= PAGE_SIZE`.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8f03eb5f0f91fddc9bb8563c7e82bd7d3ba1dd0
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce00897b94bc5c62fab962625efcf1ab824d3688
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
+---
+ util.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/util.c b/util.c
+index 9eba4836ba6a..d42678169b2d 100644
+--- a/util.c
++++ b/util.c
+@@ -21,6 +21,7 @@
+ 
+ #include <crypto/scatterwalk.h>
+ #include <linux/scatterlist.h>
++#include <linux/version.h>
+ #include "util.h"
+ 
+ /* These were taken from Maxim Levitsky's patch to lkml.
+@@ -44,8 +45,12 @@ struct scatterlist *sg_advance(struct scatterlist *sg, int consumed)
+ 	sg->length -= consumed;
+ 
+ 	if (sg->offset >= PAGE_SIZE) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0))
++		struct page *page = sg_page(sg) + (sg->offset / PAGE_SIZE);
++#else
+ 		struct page *page =
+ 			nth_page(sg_page(sg), sg->offset / PAGE_SIZE);
++#endif
+ 		sg_set_page(sg, page, sg->length, sg->offset % PAGE_SIZE);
+ 	}
+ 
diff --git a/patches/cryptodev-linux-1.14/series b/patches/cryptodev-linux-1.14/series
index 12704929b..d832ab663 100644
--- a/patches/cryptodev-linux-1.14/series
+++ b/patches/cryptodev-linux-1.14/series
@@ -3,4 +3,5 @@
 0001-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch
 0002-Exclude-unused-struct-since-Linux-6.5.patch
 0003-Fix-uninitialized-session-pointers.patch
-# b25ab355176e0ac9ad9433b6a050c0e4  - git-ptx-patches magic
+0004-Fix-build-for-Linux-6.18-rc1.patch
+# 3025afd546f1ec2e0afecd54c87e23d2  - git-ptx-patches magic
-- 
2.47.3




  reply	other threads:[~2026-02-22 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-22 15:17 [ptxdist] [PATCH 0/3] cryptodev update Ladislav Michl
2026-02-22 15:18 ` Ladislav Michl [this message]
2026-02-22 15:19 ` [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform Ladislav Michl
2026-02-22 15:19 ` [ptxdist] [PATCH 3/3] cryptodev: simplify rules Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZseOz6OvD4jmTQw@lenoch \
    --to=oss-lists@triops.cz \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox