diff mbox series

[meta-arago,master] cryptodev-module: Add patch to fix 6.18 build issue

Message ID 20251209193648.3581363-1-reatmon@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,master] cryptodev-module: Add patch to fix 6.18 build issue | expand

Commit Message

Ryan Eatmon Dec. 9, 2025, 7:36 p.m. UTC
Backport a patch [1] to address a 6.18 kernel compile issue.

[1] https://github.com/cryptodev-linux/cryptodev-linux/commit/08644db02d43478f802755903212f5ee506af73b

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 .../cryptodev/cryptodev-module-arago.inc      |  4 ++
 .../0001-Fix-build-for-Linux-6-18-rc1.patch   | 53 +++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module/0001-Fix-build-for-Linux-6-18-rc1.patch

Comments

PRC Automation Dec. 9, 2025, 7:57 p.m. UTC | #1
meta-arago / na / 20251209193648.3581363-1-reatmon

PRC Results: PASS

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
All patches passed



=========================================================
  apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [meta-arago][master][PATCH] cryptodev-module: Add patch to fix 6.18 build issue
- Submitter: From: Ryan Eatmon <reatmon@ti.com>
+From: =3D?UTF-8?q?Joan=3D20Bruguera=3D20Mic=3DC3=3DB3?=3D <joanbrugueram@g=
- Date: Date: Tue, 9 Dec 2025 13:36:43 -0600
+Date: Sat, 6 Sep 2025 20:36:38 +0000
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: 9b9f8e633f8ad8bf94ebb121e692fae7f2f216be

Applied to:
- Repository: lcpd-prc-meta-arago
- Base Branch: master-next
- Commit Author: LCPD Automation Script <lcpdbld@list.ti.com>
- Commit Subject: CI/CD Auto-Merger: cicd.master.202512090100
- Commit SHA: 984999baf5085a912dff08708e2417baab5d15ad

Patches
----------------------------------------
All patches applied



=========================================================
  check-yocto-repo: PASS
=========================================================
master
=====================
PASS



=========================================================
  yocto-check-layers: PASS
=========================================================
master - PASS
=====================
All checks passed
diff mbox series

Patch

diff --git a/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module-arago.inc b/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module-arago.inc
index 74688f1c..9bd89679 100644
--- a/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module-arago.inc
+++ b/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module-arago.inc
@@ -1,3 +1,7 @@ 
 PR:append = ".arago0"
 
 KERNEL_MODULE_AUTOLOAD += "cryptodev"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/cryptodev-module:"
+
+SRC_URI += "file://0001-Fix-build-for-Linux-6-18-rc1.patch"
diff --git a/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module/0001-Fix-build-for-Linux-6-18-rc1.patch b/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module/0001-Fix-build-for-Linux-6-18-rc1.patch
new file mode 100644
index 00000000..d7f1d05c
--- /dev/null
+++ b/meta-arago-distro/recipes-kernel/cryptodev/cryptodev-module/0001-Fix-build-for-Linux-6-18-rc1.patch
@@ -0,0 +1,53 @@ 
+From 08644db02d43478f802755903212f5ee506af73b Mon Sep 17 00:00:00 2001
+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
+
+Upstream-Status: Backport [https://github.com/cryptodev-linux/cryptodev-linux/commit/08644db02d43478f802755903212f5ee506af73b]
+
+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 9eba4836..d4267816 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);
+ 	}
+