Repository: openwrt/openwrt
Pull request #18661: kernel: modules: some dependency updates for 6.12 kernel
Author: login: DragonBluep
Labels: name: kernel
description: pull request/issue with Linux kernel related changes
name: core packages
description: pull request/issue for core (in-tree) packages
Created: 2025-05-01T03:45:07Z | Merged: 2025-05-08T20:34:43Z



Diff:
diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk
index cbd965f3eda705..e7b59860b69360 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -31,7 +31,7 @@ define KernelPackage/fs-afs
   SUBMENU:=$(FS_MENU)
   TITLE:=Andrew FileSystem client
   DEFAULT:=n
-  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +LINUX_6_6:kmod-fs-fscache +!LINUX_6_6:kmod-fs-netfs
   KCONFIG:=\
 	CONFIG_AFS_FS=m \
 	CONFIG_AFS_DEBUG=n \
@@ -83,6 +83,22 @@ endef
 $(eval $(call KernelPackage,fs-btrfs))
 
 
+define KernelPackage/fs-cachefiles
+  SUBMENU:=$(FS_MENU)
+  TITLE:=Filesystem caching on files
+  DEPENDS:=LINUX_6_6:kmod-fs-fscache !LINUX_6_6:kmod-fs-netfs
+  KCONFIG:=\
+	CONFIG_CACHEFILES \
+	CONFIG_CACHEFILES_DEBUG=n \
+	CONFIG_CACHEFILES_ERROR_INJECTION=n \
+	CONFIG_CACHEFILES_ONDEMAND=n
+  FILES:= $(LINUX_DIR)/fs/cachefiles/cachefiles.ko
+  AUTOLOAD:=$(call AutoLoad,30,cachefiles)
+endef
+
+$(eval $(call KernelPackage,fs-cachefiles))
+
+
 define KernelPackage/fs-smbfs-common
   SUBMENU:=$(FS_MENU)
   TITLE:=SMBFS common dependencies support
@@ -262,23 +278,13 @@ $(eval $(call KernelPackage,fs-f2fs))
 define KernelPackage/fs-fscache
   SUBMENU:=$(FS_MENU)
   TITLE:=General filesystem local cache manager
-  DEPENDS:=+kmod-fs-netfs
+  DEPENDS:=@LINUX_6_6 +kmod-fs-netfs
   KCONFIG:=\
-	CONFIG_FSCACHE@lt6.12 \
-	CONFIG_FSCACHE=y@ge6.12 \
+	CONFIG_FSCACHE \
 	CONFIG_FSCACHE_STATS=y \
-	CONFIG_FSCACHE_HISTOGRAM=n \
-	CONFIG_FSCACHE_DEBUG=n \
-	CONFIG_FSCACHE_OBJECT_LIST=n \
-	CONFIG_CACHEFILES \
-	CONFIG_CACHEFILES_DEBUG=n \
-	CONFIG_CACHEFILES_HISTOGRAM=n \
-	CONFIG_CACHEFILES_ERROR_INJECTION=n \
-	CONFIG_CACHEFILES_ONDEMAND=n
-  FILES:= \
-	$(LINUX_DIR)/fs/fscache/fscache.ko@lt6.12 \
-	$(LINUX_DIR)/fs/cachefiles/cachefiles.ko
-  AUTOLOAD:=$(call AutoLoad,29,fscache cachefiles)
+	CONFIG_FSCACHE_DEBUG=n
+  FILES:= $(LINUX_DIR)/fs/fscache/fscache.ko
+  AUTOLOAD:=$(call AutoLoad,29,fscache)
 endef
 
 $(eval $(call KernelPackage,fs-fscache))
@@ -423,7 +429,10 @@ $(eval $(call KernelPackage,fs-msdos))
 define KernelPackage/fs-netfs
   SUBMENU:=$(FS_MENU)
   TITLE:=Network Filesystems support
-  KCONFIG:= CONFIG_NETFS_SUPPORT
+  KCONFIG:=
+	CONFIG_NETFS_SUPPORT \
+	CONFIG_FSCACHE=y@ge6.12 \
+	CONFIG_FSCACHE_STATS=y@ge6.12
   FILES:=$(LINUX_DIR)/fs/netfs/netfs.ko
   AUTOLOAD:=$(call AutoLoad,28,netfs)
 endef
diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index ff80cd8d27ad54..8da6216cbf244a 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -949,11 +949,7 @@ $(eval $(call KernelPackage,keys-trusted))
 define KernelPackage/tpm
   SUBMENU:=$(OTHER_MENU)
   TITLE:=TPM Hardware Support
-  DEPENDS:= +kmod-random-core +kmod-asn1-decoder \
-	  +kmod-asn1-encoder +kmod-oid-registry \
-	  +!LINUX_6_6:kmod-crypto-ecdh \
-	  +!LINUX_6_6:kmod-crypto-kpp \
-	  +!LINUX_6_6:kmod-crypto-lib-aescfb
+  DEPENDS:= +kmod-random-core
   KCONFIG:= CONFIG_TCG_TPM
   FILES:= $(LINUX_DIR)/drivers/char/tpm/tpm.ko
   AUTOLOAD:=$(call AutoLoad,10,tpm,1)
diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk
index 8153c54069a3a1..c622ce964e388c 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -129,7 +129,7 @@ define KernelPackage/fb
 	CONFIG_VT_HW_CONSOLE_BINDING=y
   FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko \
 	$(LINUX_DIR)/lib/fonts/font.ko \
-	$(LINUX_DIR)/drivers/video/fbdev/core/fb_io_fops.ko
+	$(LINUX_DIR)/drivers/video/fbdev/core/fb_io_fops.ko@lt6.8
   AUTOLOAD:=$(call AutoLoad,06,fb font)
 endef
 


Reviews:
user: login: chunkeey
body: (messed up, sorry. posted the same comment below with the necessary context reference)
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-01T17:27:55Z
user: login: chunkeey
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-01T17:29:00Z
user: login: DragonBluep
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-01T17:54:22Z
user: login: chunkeey
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-01T20:56:55Z
user: login: DragonBluep
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-02T02:01:03Z
user: login: chunkeey
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-03T14:13:39Z
user: login: hauke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-03T20:03:05Z
user: login: DragonBluep
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-05T12:29:21Z

Review comments:
diff_hunk: @@ -949,11 +949,7 @@ $(eval $(call KernelPackage,keys-trusted))
 define KernelPackage/tpm
   SUBMENU:=$(OTHER_MENU)
   TITLE:=TPM Hardware Support
-  DEPENDS:= +kmod-random-core +kmod-asn1-decoder \
-	  +kmod-asn1-encoder +kmod-oid-registry \
-	  +!LINUX_6_6:kmod-crypto-ecdh \
-	  +!LINUX_6_6:kmod-crypto-kpp \
-	  +!LINUX_6_6:kmod-crypto-lib-aescfb
+  DEPENDS:= +kmod-random-core
path: package/kernel/linux/modules/other.mk
user: login: chunkeey
body: This is strange. Most of these dependencies were recently added by https://github.com/openwrt/openwrt/commit/0caa30b66aaa2186bb875453c2b92d9cd3e27303

And looking at 6.12.x I would think that tpm2-session.c:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/char/tpm/tpm2-sessions.c?h=linux-6.12.y#n681

needs at least crypto-lib-aescfb in some form or another. Is your testing target including it (and potentially all the others) as =y by chance in the targets config?
created_at: 2025-05-01T17:29:00Z
author_association: MEMBER
diff_hunk: @@ -949,11 +949,7 @@ $(eval $(call KernelPackage,keys-trusted))
 define KernelPackage/tpm
   SUBMENU:=$(OTHER_MENU)
   TITLE:=TPM Hardware Support
-  DEPENDS:= +kmod-random-core +kmod-asn1-decoder \
-	  +kmod-asn1-encoder +kmod-oid-registry \
-	  +!LINUX_6_6:kmod-crypto-ecdh \
-	  +!LINUX_6_6:kmod-crypto-kpp \
-	  +!LINUX_6_6:kmod-crypto-lib-aescfb
+  DEPENDS:= +kmod-random-core
path: package/kernel/linux/modules/other.mk
user: login: DragonBluep
body: > This is strange. Most of these dependencies were recently added by [0caa30b](https://github.com/openwrt/openwrt/commit/0caa30b66aaa2186bb875453c2b92d9cd3e27303)
> 
> And looking at 6.12.x I would think that tpm2-session.c: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/char/tpm/tpm2-sessions.c?h=linux-6.12.y#n681

The symbol `CONFIG_TCG_TPM2_HMAC` is not enabled on OpenWrt. Hence these codes won't be compiled at all.
https://git.openwrt.org/?p=openwrt%2Fopenwrt.git&a=search&h=HEAD&st=grep&s=CONFIG_TCG_TPM2_HMAC

> 
> needs at least crypto-lib-aescfb in some form or another. Is your testing target including it (and potentially all the others) as =y by chance in the targets config?

I remember I didn't catch any error about this tpm package on x86 6.12 kernel and ath79 6.6&6.12 kernel with `CONFIG_ALL_KMOD=y`.

created_at: 2025-05-01T17:54:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -949,11 +949,7 @@ $(eval $(call KernelPackage,keys-trusted))
 define KernelPackage/tpm
   SUBMENU:=$(OTHER_MENU)
   TITLE:=TPM Hardware Support
-  DEPENDS:= +kmod-random-core +kmod-asn1-decoder \
-	  +kmod-asn1-encoder +kmod-oid-registry \
-	  +!LINUX_6_6:kmod-crypto-ecdh \
-	  +!LINUX_6_6:kmod-crypto-kpp \
-	  +!LINUX_6_6:kmod-crypto-lib-aescfb
+  DEPENDS:= +kmod-random-core
path: package/kernel/linux/modules/other.mk
user: login: chunkeey
body: > > This is strange. Most of these dependencies were recently added by [0caa30b](https://github.com/openwrt/openwrt/commit/0caa30b66aaa2186bb875453c2b92d9cd3e27303)
> > And looking at 6.12.x I would think that tpm2-session.c: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/char/tpm/tpm2-sessions.c?h=linux-6.12.y#n681
> 
> The symbol `CONFIG_TCG_TPM2_HMAC` is not enabled on OpenWrt. Hence these codes won't be compiled at all. https://git.openwrt.org/?p=openwrt%2Fopenwrt.git&a=search&h=HEAD&st=grep&s=CONFIG_TCG_TPM2_HMAC
> 
> > needs at least crypto-lib-aescfb in some form or another. Is your testing target including it (and potentially all the others) as =y by chance in the targets config?
> 
> I remember I didn't catch any error about this tpm package on x86 6.12 kernel and ath79 6.6&6.12 kernel with `CONFIG_ALL_KMOD=y`.

it's getting even stranger now?! The same author @namiltd also added that ``# CONFIG_TCG_TPM2_HMAC is not set`` in commit bcfd1b8d142c6fb31413565323dc671644932cbd (which seems to have an earlier date). I think he did it because of this comment by @graysky2: https://github.com/openwrt/openwrt/pull/16547#issuecomment-2489336882  (there are more follow ups on it too).

And reading the Kconfig Help text, it could make sense to enable it in  on it:

     Setting this causes us to deploy a scheme which uses request
     and response HMACs in addition to encryption for
     communicating with the TPM to prevent or detect bus snooping
     and interposer attacks (see tpm-security.rst).  Saying Y
     here adds some encryption overhead to all kernel to TPM
     transactions.

so from what I can tell, this setting helps to protect systems with dedicated TPM2 chips, or depending on ones view: waste cycles. 6.12.y's Kconfig for CONFIG_TCG_TPM2_HMAC sets it to [default x86_64](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/char/tpm/Kconfig?h=linux-6.12.y#n32) 🤷. 


Reading the comments, it doesn't look like @graysky2 was interested in that feature. It looks like, it broke and adding the packages was the easiest fix.
created_at: 2025-05-01T20:56:55Z
author_association: MEMBER
diff_hunk: @@ -949,11 +949,7 @@ $(eval $(call KernelPackage,keys-trusted))
 define KernelPackage/tpm
   SUBMENU:=$(OTHER_MENU)
   TITLE:=TPM Hardware Support
-  DEPENDS:= +kmod-random-core +kmod-asn1-decoder \
-	  +kmod-asn1-encoder +kmod-oid-registry \
-	  +!LINUX_6_6:kmod-crypto-ecdh \
-	  +!LINUX_6_6:kmod-crypto-kpp \
-	  +!LINUX_6_6:kmod-crypto-lib-aescfb
+  DEPENDS:= +kmod-random-core
path: package/kernel/linux/modules/other.mk
user: login: DragonBluep
body: I agree it's a good idea to enable this feature for tpm package, at least for x86_64. But considering that this PR is just a quick build fix for the 6.12 kernel, I really don't want to do it here. And the x86 6.12 kernel config looks messy for me. It seems that they were manually modified, not `make kernel_oldconfig`. I do believe some kernel symbols do not take effect at all. Perhaps CONFIG_TCG_TPM2_HMAC has already been implicitly enabled, who knows. I've tried make things clear in https://github.com/openwrt/openwrt/pull/18632. However it's too late.

BTW. @graysky2 I noticed that you plan to add some new features to x86 in https://github.com/openwrt/openwrt/pull/18203. Please make sure that you should use `make kernel_menuconfig CONFIG_TARGET=subtarget` to edit the config files. For 6.6 kernel, you can just rebase your work on https://github.com/openwrt/openwrt/pull/18632.
created_at: 2025-05-02T02:01:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -31,11 +31,13 @@ define KernelPackage/fs-afs
   SUBMENU:=$(FS_MENU)
   TITLE:=Andrew FileSystem client
   DEFAULT:=n
-  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +LINUX_6_6:kmod-fs-fscache +!LINUX_6_6:kmod-fs-netfs
   KCONFIG:=\
 	CONFIG_AFS_FS=m \
 	CONFIG_AFS_DEBUG=n \
-	CONFIG_AFS_FSCACHE=y
+	CONFIG_AFS_FSCACHE=y \
+	CONFIG_FSCACHE=y@ge6.12 \
+	CONFIG_FSCACHE_STATS=y@ge6.12
path: package/kernel/linux/modules/fs.mk
user: login: hauke
body: The fscache support is compile into the `fs/netfs/netfs.ko` file of the `KernelPackage/fs-netfs` package. 

You should move these options to the `KernelPackage/fs-netfs` package. 
created_at: 2025-05-03T20:03:05Z
author_association: MEMBER
diff_hunk: @@ -31,11 +31,13 @@ define KernelPackage/fs-afs
   SUBMENU:=$(FS_MENU)
   TITLE:=Andrew FileSystem client
   DEFAULT:=n
-  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +LINUX_6_6:kmod-fs-fscache +!LINUX_6_6:kmod-fs-netfs
   KCONFIG:=\
 	CONFIG_AFS_FS=m \
 	CONFIG_AFS_DEBUG=n \
-	CONFIG_AFS_FSCACHE=y
+	CONFIG_AFS_FSCACHE=y \
+	CONFIG_FSCACHE=y@ge6.12 \
+	CONFIG_FSCACHE_STATS=y@ge6.12
path: package/kernel/linux/modules/fs.mk
user: login: DragonBluep
body: Fixed. Thanks!
created_at: 2025-05-05T12:29:21Z
author_association: CONTRIBUTOR

PR comments:
user: login: namiltd
created_at: 2025-05-09T20:43:04Z
body: Look at https://github.com/torvalds/linux/commit/4232739709060703e9dd6f5d6839c37e008d389d (also implemented in Kernel 6.8)
This commit makes fb_io_fops.ko required again. So your commit https://github.com/openwrt/openwrt/pull/18661/commits/5048c9d501ad8547f8bd88cc910ef0aa2f92cc25 sould be reversed!

While compiling kernel 6.12.28 for geode I got an error that surprised me:
```
Package kmod-drm-radeon is missing dependencies for the following libraries:
fb_io_fops.ko
make[2]: *** [modules/video.mk:620: /__w/openwrt/openwrt/openwrt/bin/targets/x86/geode/packages/kmod-drm-radeon-6.12.28-r1.apk] Error 1
time: package/kernel/linux/compile#45.35#40.01#75.34
```
Reverting https://github.com/openwrt/openwrt/pull/18661/commits/5048c9d501ad8547f8bd88cc910ef0aa2f92cc25 solved the problem.

author_association: CONTRIBUTOR
user: login: DragonBluep
created_at: 2025-05-10T04:23:52Z
body: > Look at [torvalds/linux@4232739](https://github.com/torvalds/linux/commit/4232739709060703e9dd6f5d6839c37e008d389d) (also implemented in Kernel 6.8) This commit makes fb_io_fops.ko required again. So your commit [5048c9d](https://github.com/openwrt/openwrt/commit/5048c9d501ad8547f8bd88cc910ef0aa2f92cc25) sould be reversed!
> 
> While compiling kernel 6.12.28 for geode I got an error that surprised me:
> 
> ```
> Package kmod-drm-radeon is missing dependencies for the following libraries:
> fb_io_fops.ko
> make[2]: *** [modules/video.mk:620: /__w/openwrt/openwrt/openwrt/bin/targets/x86/geode/packages/kmod-drm-radeon-6.12.28-r1.apk] Error 1
> time: package/kernel/linux/compile#45.35#40.01#75.34
> ```
> 
> Reverting [5048c9d](https://github.com/openwrt/openwrt/commit/5048c9d501ad8547f8bd88cc910ef0aa2f92cc25) solved the problem.

It is a correct fix. I remember it fixed the minimum build for the x86 target. You need to find the real reason. I will investigate it later.
author_association: CONTRIBUTOR
user: login: namiltd
created_at: 2025-05-10T09:36:11Z
body: The file include/linux/fb.h still uses fb_io_read, fb_io_write, and fb_io_mmap, so you can't disable fb_io_fops.ko.

The file drivers/gpu/drm/radeon/radeon_fbdev.c uses FB_DEFAULT_IOMEM_OPS which contains fb_io_read, fb_io_write, and fb_io_mmap,

author_association: CONTRIBUTOR
user: login: namiltd
created_at: 2025-05-10T10:16:23Z
body: Fix PR https://github.com/openwrt/openwrt/pull/18771
author_association: CONTRIBUTOR