Skip to content

Conversation

@graysky2
Copy link
Contributor

@graysky2 graysky2 commented Dec 21, 2025

mac80211: backports: fix ath9k/ath11k compatibility with Linux 6.18+

Linux 6.18 introduces several API removals and signature changes that break
builds of ath9k and ath11k in the mac80211 backports tree. This patchset
restores compatibility while preserving support for older kernels used by
OpenWrt and other downstreams.

@github-actions github-actions bot added the core packages pull request/issue for core (in-tree) packages label Dec 21, 2025
@namiltd
Copy link
Contributor

namiltd commented Dec 21, 2025

Please update the first patch: mac80211_fix_build_failure_on_kernel_6_18.patch
(git am ../mac80211_fix_build_failure_on_kernel_6_18.patch)

@namiltd
Copy link
Contributor

namiltd commented Dec 21, 2025

Patch build/400-restore-old-debugfs_fops.patch for kernel 6.18 is probably unnecessary, so it should be modified to work only for kernel 6.12 (add #if LINUX_VERSION_IS_LESS(6,18,0) to changes).
After these changes mac80211: add debugfs_real_fops() compatibility macro will be useless.

@graysky2
Copy link
Contributor Author

Do you mind working together with me on this? I am running out of time. If you can fork and send me PR, that would be great.

@namiltd
Copy link
Contributor

namiltd commented Dec 21, 2025

Fixed, but not tested yet patch: 400-restore-old-debugfs_fops.patch

@graysky2
Copy link
Contributor Author

ok so delete 400-add-debugfs_real_fops.patch and add your patch?

@namiltd
Copy link
Contributor

namiltd commented Dec 22, 2025

replace

@graysky2
Copy link
Contributor Author

got a commit message?

@namiltd
Copy link
Contributor

namiltd commented Dec 22, 2025

No, the original 400-restore-old-debugfs_fops.patch didn't have it either.

@graysky2
Copy link
Contributor Author

I meant for the inclusion of the patch 😄

@graysky2 graysky2 force-pushed the 6.18-mac80211 branch 2 times, most recently from 70d84f4 to 2c678a9 Compare December 22, 2025 14:38
Comment on lines 8 to 15
#ifndef SOCKWQ_ASYNC_NOSPACE
#define SOCKWQ_ASYNC_NOSPACE SOCK_ASYNC_NOSPACE
#endif
#ifndef SOCKWQ_ASYNC_WAITDATA
#define SOCKWQ_ASYNC_WAITDATA SOCK_ASYNC_WAITDATA
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just remove these two defines, they are already included in Linux 4.4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would remove the patch entirely. Correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you just remove the patch you will probably still run into these problems with kernel 6.18.

Change the patch to remove the definitions from the code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the original patch adding this instead:
package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you want me to replace 552-ath...patch with 548-ath...patch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He wants the change directly in package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the latest push what you intended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the original patch:
package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch

from_timer was renamed, see:
torvalds/linux@41cb085

Copy link
Member

@hauke hauke Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the code where it is used with:

#ifdef timer_container_of
timer_container_of(...)
#else
from_timer(...)
#endif

Copy link
Member

@hauke hauke Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the original patch.

This was renamed in
torvalds/linux@367ed4e

@namiltd
Copy link
Contributor

namiltd commented Dec 23, 2025

You copied 400-restore-old-debugfs_fops.patch to the wrong folder, it should be in build.

@namiltd
Copy link
Contributor

namiltd commented Dec 24, 2025

206.patch
git am ..\206.patch

@namiltd
Copy link
Contributor

namiltd commented Dec 24, 2025

Import updated patches from namiltd#107

Comment on lines 7 to 14
+#if LINUX_VERSION_IS_LESS(6,16,0)
#ifndef SOCKWQ_ASYNC_NOSPACE
#define SOCKWQ_ASYNC_NOSPACE SOCK_ASYNC_NOSPACE
#endif
#ifndef SOCKWQ_ASYNC_WAITDATA
#define SOCKWQ_ASYNC_WAITDATA SOCK_ASYNC_WAITDATA
#endif
+#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace it with:

-#ifndef SOCKWQ_ASYNC_NOSPACE
-#define SOCKWQ_ASYNC_NOSPACE   SOCK_ASYNC_NOSPACE
-#endif
-#ifndef SOCKWQ_ASYNC_WAITDATA
-#define SOCKWQ_ASYNC_WAITDATA   SOCK_ASYNC_WAITDATA
-#endif

@namiltd
Copy link
Contributor

namiltd commented Dec 25, 2025

PR #20965 updated. I also added patches for mac80211 to it, allowing to test them on malta.

@namiltd
Copy link
Contributor

namiltd commented Dec 25, 2025

Since 501e54b commits mac80211: ath11k: fix build on 6.18 and mac80211: ath11k: add del_timer_sync() compat shim are unnecessary.

@graysky2
Copy link
Contributor Author

graysky2 commented Dec 31, 2025

When I build mt76 with the testing kernel enabled, with #21240 applied, and with openwrt/mt76#1026 applied (to correct the build), it ends in modpost errors. Is that due to something missing in this PR or something else?

...
  LD [M]  mt7603/mt7603e.o
  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7603/mt7603e.o
ERROR: modpost: "ieee80211_sta_register_airtime" [mt76.ko] undefined!
ERROR: modpost: "__ieee80211_schedule_txq" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_free_hw" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_probereq_get" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_txq_schedule_start" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_tx_status_ext" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_register_hw" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_sta_eosp" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_get_hdrlen_from_skb" [mt76.ko] undefined!
ERROR: modpost: "ieee80211_get_tx_rates" [mt76.ko] undefined!
WARNING: modpost: suppressed 67 unresolved symbol warnings because there were too many)
make[7]: *** [/scratch/union/build_dir/target-x86_64-openwrt-linux-musl_musl/linux-x86_64/linux-6.18.2/scripts/Makefile.modpost:147: Module.symvers] Error 1

@namiltd
Copy link
Contributor

namiltd commented Dec 31, 2025

@graysky2 This is a problem with the ath10k-ct (ath10k-ct-regular) package, not mt76, which also needs to be adapted to the 6.18 kernel.

@graysky2
Copy link
Contributor Author

openwrt/backports#1

@graysky2
Copy link
Contributor Author

This is a problem with the ath10k-ct (ath10k-ct-regular) package, not mt76, which also needs to be adapted to the 6.18 kernel.

I know it too does not build, but, in my test .config I am not building it.

# CONFIG_PACKAGE_kmod-ath10k-ct is not set
# CONFIG_PACKAGE_kmod-ath10k-ct-smallbuffers is not set
# CONFIG_PACKAGE_mt76-test is not set
# CONFIG_PACKAGE_mt7601u-firmware is not set
# CONFIG_PACKAGE_mt7622bt-firmware is not set
CONFIG_PACKAGE_kmod-mt76=y
CONFIG_PACKAGE_kmod-mt76-core=y
# CONFIG_PACKAGE_kmod-mt7601u is not set
CONFIG_PACKAGE_kmod-mt7603=y
# CONFIG_PACKAGE_kmod-mt7615-firmware is not set
# CONFIG_PACKAGE_kmod-mt7615e is not set
# CONFIG_PACKAGE_kmod-mt7622-firmware is not set
# CONFIG_PACKAGE_kmod-mt7663-firmware-ap is not set
# CONFIG_PACKAGE_kmod-mt7663-firmware-sta is not set
# CONFIG_PACKAGE_kmod-mt7663s is not set
# CONFIG_PACKAGE_kmod-mt7663u is not set
CONFIG_PACKAGE_kmod-mt76x02-common=y
# CONFIG_PACKAGE_kmod-mt76x0e is not set
# CONFIG_PACKAGE_kmod-mt76x0u is not set
CONFIG_PACKAGE_kmod-mt76x2=y
CONFIG_PACKAGE_kmod-mt76x2-common=y
# CONFIG_PACKAGE_kmod-mt76x2u is not set

@namiltd
Copy link
Contributor

namiltd commented Jan 1, 2026

Leave patch mac80211: fix Module.symvers.tmp generation on kernel 6.18 separate (like I did) so you only update it when a better workaround is found.


-
+/* Linux ≥ 6.7 removed SOCK_ASYNC_* */
+#if defined(SOCK_ASYNC_NOSPACE) && defined(SOCK_ASYNC_WAITDATA)
Copy link
Contributor

@namiltd namiltd Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed out by @hauke (#21240 (comment)) there is no point in leaving this code since we support kernel 6.12 (and in the future 6.18) where it is unnecessary. That's what I did in mac80211: fix build failure on kernel 6.18

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ... I removed it

@graysky2 graysky2 force-pushed the 6.18-mac80211 branch 2 times, most recently from 0ed45ce to 6c4ffa3 Compare January 1, 2026 13:19
@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

Leave patch mac80211: fix Module.symvers.tmp generation on kernel 6.18 separate (like I did) so you only update it when a better workaround is found.

I see you included this patch in 5a537c7

It removed most of those modpost errors but there are two yet:

...
  LD [M]  mt7915/mt7915e.o
  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-sdio.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-connac-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7603/mt7603e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663-usb-sdio-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7915/mt7915e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7996/mt7996e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925u.o
ERROR: modpost: "mt792x_roc_timer" [mt7921/mt7921-common.ko] undefined!
ERROR: modpost: "mt792x_roc_timer" [mt7925/mt7925-common.ko] undefined!
make[6]: *** [/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/scripts/Makefile.modpost:147: Module.symvers] Error 1

@namiltd
Copy link
Contributor

namiltd commented Jan 1, 2026

Try 999-patch.patch instead of 600-fix_module_symvers_tmp_generation_on_6.18.patch

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

I replaced package/kernel/mac80211/patches/build/600-fix_module_symvers_tmp_generation_on_6.18.patch with 999-patch.patch, rebuilt mac80211 then rebuilt mt76 but still hitting that error:

...
  LD [M]  mt7615/mt7663s.o
  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-sdio.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-connac-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7603/mt7603e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663-usb-sdio-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7915/mt7915e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7996/mt7996e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925u.o
ERROR: modpost: "mt792x_roc_timer" [mt7921/mt7921-common.ko] undefined!
ERROR: modpost: "mt792x_roc_timer" [mt7925/mt7925-common.ko] undefined!
make[6]: *** [/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/scripts/Makefile.modpost:147: Module.symvers] Error 1

@namiltd
Copy link
Contributor

namiltd commented Jan 1, 2026

Check if CONFIG_PACKAGE_kmod-mt792x-common is enabled

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

Check if CONFIG_PACKAGE_kmod-mt792x-common is enabled

Yes:

% grep kmod-mt792x .config
CONFIG_PACKAGE_kmod-mt792x-common=m
CONFIG_PACKAGE_kmod-mt792x-usb=m

@namiltd
Copy link
Contributor

namiltd commented Jan 1, 2026

Maybe we should play around with Module.symvers.tmp a bit more. If it's run too early, it doesn't see all the symbols yet.
e.g.:

--- a/Makefile.build	2026-01-01 02:45:30.896248600 +0100
+++ b/Makefile.build	2026-01-01 03:13:31.345841800 +0100
@@ -11,6 +11,11 @@
 .PHONY: modules
 modules:
 	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules
+	@echo "Running final modpost after . ko files are ready..."
+	@$(KLIB_BUILD)/scripts/mod/modpost -M \
+		-o $(BACKPORT_DIR)/Module.symvers.tmp \
+		-T $(BACKPORT_DIR)/modules.order \
+		-i $(KLIB_BUILD)/Module.symvers
 
 .PHONY: clean
 clean:

or

--- a/Makefile.build	2026-01-01 02:45:30.896248600 +0100
+++ b/Makefile.build	2026-01-01 03:13:31.345841800 +0100
@@ -11,6 +11,12 @@
 .PHONY: modules
 modules:
 	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules
+	@echo "Running final modpost after . ko files are ready..."
+	@$(KLIB_BUILD)/scripts/mod/modpost -M \
+		-o $(BACKPORT_DIR)/Module.symvers.tmp \
+		-T $(BACKPORT_DIR)/modules.order \
+		-i $(KLIB_BUILD)/Module.symvers \
+		$(BACKPORT_DIR)/*.ko
 
 .PHONY: clean
 clean:

or... I'm tired of searching

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

Thanks for the suggestions. I the first one did not fix (again, replace the 600-.*patch in mac80211, rebuilt mac80211, then build mt76.

Result from first patch (mac80211 built fine)

ERROR: modpost: "mt792x_roc_timer" [mt7921/mt7921-common.ko] undefined!
ERROR: modpost: "mt792x_roc_timer" [mt7925/mt7925-common.ko] undefined!

Result from 2nd patch was a build failure of mac80211 since no .ko files were present.

 LD [M]  net/mac80211/mac80211.o
  LD [M]  net/wireless/cfg80211.o
  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in compat/compat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/net/wireless/mediatek/mt7601u/mt7601u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/wireless/cfg80211.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mac80211/mac80211.o
  CC [M]  compat/compat.mod.o
  CC [M]  .module-common.o
  CC [M]  drivers/net/wireless/mediatek/mt7601u/mt7601u.mod.o
  CC [M]  net/wireless/cfg80211.mod.o
  CC [M]  net/mac80211/mac80211.mod.o
  LD [M]  net/mac80211/mac80211.ko
  LD [M]  compat/compat.ko
  LD [M]  drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
  LD [M]  net/wireless/cfg80211.ko
Running final modpost after . ko files are ready...
/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/*.ko: No such file or directory

I did find:

% find /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18 -name '*.ko'
/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/net/mac80211/mac80211.ko
/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/net/wireless/cfg80211.ko
/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/compat/compat.ko

And made a third patch:

--- a/Makefile.build	2026-01-01 02:45:30.896248600 +0100
+++ b/Makefile.build	2026-01-01 03:13:31.345841800 +0100
@@ -11,6 +11,15 @@ export
 .PHONY: modules
 modules:
 	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules
+	@echo "Running final modpost after . ko files are ready..."
+	@$(KLIB_BUILD)/scripts/mod/modpost -M \
+		-o $(BACKPORT_DIR)/Module.symvers.tmp \
+		-T $(BACKPORT_DIR)/modules.order \
+		-i $(KLIB_BUILD)/Module.symvers \
+		$(BACKPORT_DIR)/drivers/net/wireless/mediatek/mt7601u/*.ko \
+		$(BACKPORT_DIR)/net/mac80211/*.ko \
+		$(BACKPORT_DIR)/net/wireless/*.ko \
+		$(BACKPORT_DIR)/compat/*.ko
 
 .PHONY: clean
 clean:

But it too failed when building mac80211:

  LD [M]  net/wireless/cfg80211.o
  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in compat/compat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/net/wireless/mediatek/mt7601u/mt7601u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/wireless/cfg80211.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mac80211/mac80211.o
  CC [M]  compat/compat.mod.o
  CC [M]  .module-common.o
  CC [M]  drivers/net/wireless/mediatek/mt7601u/mt7601u.mod.o
  CC [M]  net/wireless/cfg80211.mod.o
  CC [M]  net/mac80211/mac80211.mod.o
  LD [M]  compat/compat.ko
  LD [M]  net/wireless/cfg80211.ko
  LD [M]  net/mac80211/mac80211.ko
  LD [M]  drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
Running final modpost after . ko files are ready...
ERROR: modpost: /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko: filename must be suffixed with .o
ERROR: modpost: /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/net/mac80211/mac80211.ko: filename must be suffixed with .o
ERROR: modpost: /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/net/wireless/cfg80211.ko: filename must be suffixed with .o
ERROR: modpost: /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mac80211-regular/backports-6.18/compat/compat.ko: filename must be suffixed with .o
WARNING: modpost: missing MODULE_DESCRIPTION() in compat/compat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/net/wireless/mediatek/mt7601u/mt7601u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/wireless/cfg80211.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mac80211/mac80211.o
make[5]: *** [Makefile.build:15: modules] Error 1

@namiltd
Copy link
Contributor

namiltd commented Jan 1, 2026

Try this: 600-patch.patch

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

Seems to be the same after replacing package/kernel/mac80211/patches/build/600-fix_module_symvers_tmp_generation_on_6.18.patch with the new one.

mac80211 builds successfully but mt76 ends in errors:

  MODPOST Module.symvers
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-sdio.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x02-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76-connac-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-lib.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt792x-usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x0/mt76x0-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt76x2/mt76x2u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7603/mt7603e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7615e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663-usb-sdio-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7615/mt7663s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7915/mt7915e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7921/mt7921u.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7996/mt7996e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925e.o
WARNING: modpost: missing MODULE_DESCRIPTION() in mt7925/mt7925u.o
ERROR: modpost: "mt792x_roc_timer" [mt7921/mt7921-common.ko] undefined!
ERROR: modpost: "mt792x_roc_timer" [mt7925/mt7925-common.ko] undefined!
make[6]: *** [/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/scripts/Makefile.modpost:147: Module.symvers] Error 1
make[5]: *** [/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/Makefile:1960: modpost] Error 2
make[4]: *** [/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/Makefile:248: __sub-make] Error 2
make[4]: Leaving directory '/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mt76-2025.11.06~eb567bc7'
make[3]: *** [Makefile:248: __sub-make] Error 2
make[3]: Leaving directory '/scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2'
make[2]: *** [Makefile:732: /scratch/union/build_dir/target-x86_64_glibc/linux-x86_64/mt76-2025.11.06~eb567bc7/.built] Error 2
make[2]: Leaving directory '/scratch/union/package/kernel/mt76'
time: package/kernel/mt76/compile#89.56#7.68#3.92
    ERROR: package/kernel/mt76 failed to build.
make[1]: *** [package/Makefile:187: package/kernel/mt76/compile] Error 1
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:233: package/mt76/compile] Error 2

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

what is your diffconfig? and do you only have one file:

% find build_dir/target-x86_64_glibc -name 'Module.symvers'
build_dir/target-x86_64_glibc/linux-x86_64/linux-6.18.2/Module.symvers

@graysky2
Copy link
Contributor Author

graysky2 commented Jan 1, 2026

It's working for me now with no changes. The problem was my fork of mt76 was not pointing to the same branch as openwrt/mt76#1026 but to one with a commit on top of it which removed several of the EXPORT values. Reverting that mistake allowed everything to build properly with package/kernel/mac80211/patches/build/600-fix_module_symvers_tmp_generation_on_6.18.patch from your fork intact.

What a wild goose chase this turned out to be 😠

Reintroduce old-style debugfs file_operations for kernels < 6.14 and
switch the drivers to use debugfs_short_fops + debugfs_create_file_aux
on >= 6.14. This restores compatibility with older kernels while keeping
the new debugfs API working on 6.14+.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Linux 6.16 changed the return type of gpio_chip.set() from void to int.
Add a version check so the driver builds correctly on both older and
newer kernels[1].

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.16&id=fb52f3226cab41b94f9e6ac92b1108bce324e700

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
@namiltd
Copy link
Contributor

namiltd commented Jan 2, 2026

This PR can be closed, the changes it introduces are included in #20965

@graysky2 graysky2 closed this Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants