From 40393881491aa5fd23e715d0bedf591e3b152ddd Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sat, 29 Mar 2025 13:12:44 +0100 Subject: [PATCH 01/21] mac80211: fix compilation error for old stable kernel version Fix compilation error for old stable version caused by genlmsg_multicast_allns backport fix pushed middle version. Version 5.15 version 0-169, 6.1 version 0-115, 6.6 version 0-58 have the old genlmsg_multicast_allns version with flags variable. Compiling backport project with these version result in a compilation error. To handle this, introduce a backport function for the affected kernel version. Link: https://github.com/openwrt/openwrt/pull/18373 Signed-off-by: Christian Marangi --- ...-genlmsg_multicast_allns-upstream-ba.patch | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 package/kernel/mac80211/patches/build/300-backports-handle-genlmsg_multicast_allns-upstream-ba.patch diff --git a/package/kernel/mac80211/patches/build/300-backports-handle-genlmsg_multicast_allns-upstream-ba.patch b/package/kernel/mac80211/patches/build/300-backports-handle-genlmsg_multicast_allns-upstream-ba.patch new file mode 100644 index 0000000000..5ab6bb736d --- /dev/null +++ b/package/kernel/mac80211/patches/build/300-backports-handle-genlmsg_multicast_allns-upstream-ba.patch @@ -0,0 +1,121 @@ +From 8dc94a59cfad70ec3a808add56718255eee39ab2 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sat, 29 Mar 2025 12:50:55 +0100 +Subject: [PATCH] backports: handle genlmsg_multicast_allns upstream backport + changes + +Better handle genlmsg_multicast_allns upstream backport changes that +dropped a flag to the function middle version. Use a backport function +if backports project is tried to be built on older kernel version. + +Signed-off-by: Christian Marangi +--- + backport-include/net/genetlink.h | 11 +++++ + compat/Makefile | 3 +- + compat/backport-genetlink.c | 60 +++++++++++++++++++++++ + 3 files changed, 73 insertions(+), 1 deletion(-) + +--- a/backport-include/net/genetlink.h ++++ b/backport-include/net/genetlink.h +@@ -172,4 +172,15 @@ static inline int genlmsg_parse(const st + } + #endif /* LINUX_VERSION_IS_LESS(5,2,0) */ + ++#if LINUX_VERSION_IN_RANGE(5,15,0,5,15,169) || \ ++ LINUX_VERSION_IN_RANGE(6,1,0,6,1,115) || \ ++ LINUX_VERSION_IN_RANGE(6,6,0,6,6,58) ++#define genlmsg_multicast_allns LINUX_BACKPORT(genlmsg_multicast_allns) ++int backport_genlmsg_multicast_allns(const struct genl_family *family, ++ struct sk_buff *skb, u32 portid, ++ unsigned int group); ++#endif /* LINUX_VERSION_IN_RANGE(5,15,0,5,15,169) || ++ LINUX_VERSION_IN_RANGE(6,1,0,6,1,115) || ++ LINUX_VERSION_IN_RANGE(6,6,0,6,6,58) */ ++ + #endif /* __BACKPORT_NET_GENETLINK_H */ +--- a/compat/Makefile ++++ b/compat/Makefile +@@ -16,7 +16,8 @@ compat-$(CPTCFG_KERNEL_5_9) += backport- + compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o + compat-$(CPTCFG_KERNEL_5_11) += backport-5.11.o + compat-$(CPTCFG_KERNEL_5_13) += backport-5.13.o +-compat-$(CPTCFG_KERNEL_5_15) += backport-5.15.o ++compat-$(CPTCFG_KERNEL_5_15) += backport-5.15.o backport-genetlink.o ++compat-$(CPTCFG_KERNEL_6_1) += backport-genetlink.o + compat-$(CPTCFG_KERNEL_6_4) += backport-6.4.o + + compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_LIB_ARC4) += lib-crypto-arc4.o +--- a/compat/backport-genetlink.c ++++ b/compat/backport-genetlink.c +@@ -17,6 +17,7 @@ + #include + #include + ++#if LINUX_VERSION_IS_LESS(5,2,0) + static const struct genl_family *find_family_real_ops(const struct genl_ops **ops) + { + const struct genl_family *family; +@@ -249,3 +250,63 @@ int backport_genlmsg_multicast_allns(con + return genlmsg_mcast(skb, portid, group); + } + EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns); ++#endif /* LINUX_VERSION_IS_LESS(5,2,0) */ ++ ++#if LINUX_VERSION_IN_RANGE(5,15,0,5,15,169) || \ ++ LINUX_VERSION_IN_RANGE(6,1,0,6,1,115) || \ ++ LINUX_VERSION_IN_RANGE(6,6,0,6,6,58) ++static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group) ++{ ++ struct sk_buff *tmp; ++ struct net *net, *prev = NULL; ++ bool delivered = false; ++ int err; ++ ++ rcu_read_lock(); ++ for_each_net_rcu(net) { ++ if (prev) { ++ tmp = skb_clone(skb, GFP_ATOMIC); ++ if (!tmp) { ++ err = -ENOMEM; ++ goto error; ++ } ++ err = nlmsg_multicast(prev->genl_sock, tmp, ++ portid, group, GFP_ATOMIC); ++ if (!err) ++ delivered = true; ++ else if (err != -ESRCH) ++ goto error; ++ } ++ ++ prev = net; ++ } ++ err = nlmsg_multicast(prev->genl_sock, skb, portid, group, GFP_ATOMIC); ++ ++ rcu_read_unlock(); ++ ++ if (!err) ++ delivered = true; ++ else if (err != -ESRCH) ++ return err; ++ return delivered ? 0 : -ESRCH; ++ error: ++ rcu_read_unlock(); ++ ++ kfree_skb(skb); ++ return err; ++} ++ ++int backport_genlmsg_multicast_allns(const struct genl_family *family, ++ struct sk_buff *skb, u32 portid, ++ unsigned int group) ++{ ++ if (WARN_ON_ONCE(group >= family->n_mcgrps)) ++ return -EINVAL; ++ ++ group = family->mcgrp_offset + group; ++ return genlmsg_mcast(skb, portid, group); ++} ++EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns); ++#endif /* LINUX_VERSION_IN_RANGE(5,15,0,5,15,169) || ++ LINUX_VERSION_IN_RANGE(6,1,0,6,1,115) || ++ LINUX_VERSION_IN_RANGE(6,6,0,6,6,58) */ From a3b2689e88eb7acb168ca9c36b458ed8f99485ae Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 29 Mar 2025 03:16:53 +0000 Subject: [PATCH 02/21] uboot-tools: rename patches Sanetize patch name scheme to always use 3 digits prefix. Signed-off-by: Daniel Golle --- ...-kwbimage.patch => 003-tools-dumpimage-disable-kwbimage.patch} | 0 ...-compile.patch => 004-tools-dumpimage-fix-tools-compile.patch} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename package/boot/uboot-tools/patches/{0001-tools-dumpimage-disable-kwbimage.patch => 003-tools-dumpimage-disable-kwbimage.patch} (100%) rename package/boot/uboot-tools/patches/{0002-tools-dumpimage-fix-tools-compile.patch => 004-tools-dumpimage-fix-tools-compile.patch} (100%) diff --git a/package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch b/package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch similarity index 100% rename from package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch rename to package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch diff --git a/package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch b/package/boot/uboot-tools/patches/004-tools-dumpimage-fix-tools-compile.patch similarity index 100% rename from package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch rename to package/boot/uboot-tools/patches/004-tools-dumpimage-fix-tools-compile.patch From 51b0abae52343d91ab573db6f5cecabf0ecc5a74 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 29 Mar 2025 03:53:58 +0000 Subject: [PATCH 03/21] uboot-tools: dumpimage: get rid of libopenssl dependency Get rid of of dependency on libopenssl and refresh patches. Signed-off-by: Daniel Golle --- package/boot/uboot-tools/Makefile | 4 +-- ...003-tools-dumpimage-disable-kwbimage.patch | 32 ------------------- ...3-tools-dumpimage-fix-tools-compile.patch} | 5 +-- 3 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch rename package/boot/uboot-tools/patches/{004-tools-dumpimage-fix-tools-compile.patch => 003-tools-dumpimage-fix-tools-compile.patch} (93%) diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile index dd43c65e5c..6861a70d7a 100644 --- a/package/boot/uboot-tools/Makefile +++ b/package/boot/uboot-tools/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_DISTNAME:=u-boot PKG_VERSION:=2025.01 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -26,7 +26,6 @@ define Package/dumpimage SECTION:=utils CATEGORY:=Utilities SUBMENU:=Boot Loaders - DEPENDS := +libopenssl TITLE:=dumpimage lists and extracts data from U-Boot images. URL:=http://www.denx.de/wiki/U-Boot endef @@ -62,6 +61,7 @@ define Build/Configure $(call Build/Compile/Default,tools-only_defconfig) $(call Build/Compile/Default,syncconfig) $(SED) 's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR)/.config + $(SED) 's/CONFIG_TOOLS_KWBIMAGE=y/# CONFIG_TOOLS_KWBIMAGE is not set/' $(PKG_BUILD_DIR)/.config endef MAKE_FLAGS += \ diff --git a/package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch b/package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch deleted file mode 100644 index 4af6510c44..0000000000 --- a/package/boot/uboot-tools/patches/003-tools-dumpimage-disable-kwbimage.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch -new file mode 100644 -index 0000000000..69a42ec383 ---- /dev/null -+++ b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch -@@ -0,0 +1,25 @@ -+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -+Date: Tue, 30 Nov 2021 11:29:19 +0100 -+Subject: [PATCH] tools: disable kwbimage -+MIME-Version: 1.0 -+Content-Type: text/plain; charset=UTF-8 -+Content-Transfer-Encoding: 8bit -+ -+Without CONFIG_TOOLS_LIBCRYPTO kwbimage doesn't compile because of -+multiple "undefined reference"s to SSL functions. -+ -+Signed-off-by: Rafał Miłecki -+--- -+ tools/Makefile | 1 - -+ 1 file changed, 1 deletion(-) -+ -+--- a/tools/Makefile -++++ b/tools/Makefile -+@@ -117,7 +117,6 @@ dumpimage-mkimage-objs := aisimage.o \ -+ imximage.o \ -+ imx8image.o \ -+ imx8mimage.o \ -+- kwbimage.o \ -+ lib/md5.o \ -+ lpc32xximage.o \ -+ mxsimage.o \ - diff --git a/package/boot/uboot-tools/patches/004-tools-dumpimage-fix-tools-compile.patch b/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch similarity index 93% rename from package/boot/uboot-tools/patches/004-tools-dumpimage-fix-tools-compile.patch rename to package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch index ab2e817b57..a296fd234e 100644 --- a/package/boot/uboot-tools/patches/004-tools-dumpimage-fix-tools-compile.patch +++ b/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch @@ -17,8 +17,6 @@ Signed-off-by: Scott Mercer tools/Makefile | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) -diff --git a/tools/Makefile b/tools/Makefile -index ee08a9675df8..a72b7909a066 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -22,6 +22,26 @@ @@ -68,7 +66,7 @@ index ee08a9675df8..a72b7909a066 100644 mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o HOSTLDLIBS_mkfwumdata += -luuid -@@ -313,10 +328,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \ +@@ -313,10 +328,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/ -I$(srctree)/scripts/dtc/libfdt \ -I$(srctree)/tools \ -DUSE_HOSTCC \ @@ -81,4 +79,3 @@ index ee08a9675df8..a72b7909a066 100644 $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP) $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@ - From 390e00355e9b659c92a54c526cac6774211ce351 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 29 Mar 2025 03:52:42 +0000 Subject: [PATCH 04/21] uboot-tools: add fit-check-sign package Add fit-check-sign package which allows validating a uImage.FIT. Signed-off-by: Daniel Golle --- package/boot/uboot-tools/Makefile | 20 +++- ...kip-in-tools-build-if-key-is-missing.patch | 69 ++++++++++++++ ...ols-fit_check_sign-make-key-optional.patch | 92 +++++++++++++++++++ ...12-tools-fit_check_sign-no-libcrypto.patch | 13 +++ 4 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch create mode 100644 package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch create mode 100644 package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile index 6861a70d7a..481fe77602 100644 --- a/package/boot/uboot-tools/Makefile +++ b/package/boot/uboot-tools/Makefile @@ -37,6 +37,18 @@ define Package/dumpimage/description position to outfile. endef +define Package/fit-check-sign + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Boot Loaders + TITLE:=verify uImage.FIT + URL:=http://www.denx.de/wiki/U-Boot +endef + +define Package/fit-check-sign/description + fit_check_sign validates uImage.FIT hashes and signatures +endef + define Package/uboot-envtools SECTION:=utils CATEGORY:=Utilities @@ -75,7 +87,7 @@ define Build/Compile ifneq ($(CONFIG_PACKAGE_uboot-envtools),) $(call Build/Compile/Default,envtools) endif -ifneq ($(CONFIG_PACKAGE_dumpimage),) +ifneq ($(CONFIG_PACKAGE_dumpimage)$(CONFIG_PACKAGE_fit-check-sign),) $(call Build/Compile/Default,cross_tools) endif @@ -86,6 +98,11 @@ define Package/dumpimage/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/dumpimage $(1)/usr/bin endef +define Package/fit-check-sign/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/fit_check_sign $(1)/usr/bin +endef + define Package/uboot-envtools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin @@ -109,4 +126,5 @@ define Package/uboot-envtools/install endef $(eval $(call BuildPackage,dumpimage)) +$(eval $(call BuildPackage,fit-check-sign)) $(eval $(call BuildPackage,uboot-envtools)) diff --git a/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch b/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch new file mode 100644 index 0000000000..9defb598ee --- /dev/null +++ b/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch @@ -0,0 +1,69 @@ +From patchwork Sat Mar 29 03:12:50 2025 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 2066664 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@legolas.ozlabs.org +Date: Sat, 29 Mar 2025 03:12:50 +0000 +From: Daniel Golle +To: Tom Rini , Simon Glass , + Chia-Wei Wang , u-boot@lists.denx.de +Cc: Thomas =?iso-8859-1?q?H=FChn?= +Subject: [PATCH 1/2] image-fit-sig: skip in tools build if key is missing +Message-ID: + +MIME-Version: 1.0 +Content-Disposition: inline +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.39 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" + +Skip signature verification in case no public key was given in order to +allow using fit_check_sign also to validate uImage.FIT images without +signatures. Guarded by USE_HOSTCC macro the behavior on target is +unchanged. + +Signed-off-by: Daniel Golle +--- + boot/image-fit-sig.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/boot/image-fit-sig.c ++++ b/boot/image-fit-sig.c +@@ -191,6 +191,11 @@ int fit_image_verify_required_sigs(const + int noffset; + int key_node; + ++#ifdef USE_HOSTCC ++ if (!key_blob) ++ return 0; ++#endif ++ + /* Work out what we need to verify */ + *no_sigsp = 1; + key_node = fdt_subnode_offset(key_blob, 0, FIT_SIG_NODENAME); +@@ -477,6 +482,11 @@ static int fit_config_verify_required_ke + bool reqd_policy_all = true; + const char *reqd_mode; + ++#ifdef USE_HOSTCC ++ if (!key_blob) ++ return 0; ++#endif ++ + /* + * We don't support this since libfdt considers names with the + * name root but different @ suffix to be equal diff --git a/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch b/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch new file mode 100644 index 0000000000..96ea7c434a --- /dev/null +++ b/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch @@ -0,0 +1,92 @@ +From patchwork Sat Mar 29 03:13:01 2025 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 2066665 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@legolas.ozlabs.org +Date: Sat, 29 Mar 2025 03:13:01 +0000 +From: Daniel Golle +To: Tom Rini , Simon Glass , + Chia-Wei Wang , + Daniel Golle , u-boot@lists.denx.de +Cc: Thomas =?iso-8859-1?q?H=FChn?= +Subject: [PATCH 2/2] tools/fit_check_sign: make key optional +Message-ID: + <1f0c5a1f7e84f638f921278284ff6245d78e730d.1743217745.git.daniel@makrotopia.org> +References: + +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.39 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" + +Allow invoking fit_check_sig without the key parameter, allowing to +validate only checksums and hashes for unsigned images. + +Signed-off-by: Daniel Golle +--- + tools/fit_check_sign.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +--- a/tools/fit_check_sign.c ++++ b/tools/fit_check_sign.c +@@ -45,7 +45,7 @@ int main(int argc, char **argv) + char *config_name = NULL; + char cmdname[256]; + int ret; +- void *key_blob; ++ void *key_blob = NULL; + int c; + + strncpy(cmdname, *argv, sizeof(cmdname) - 1); +@@ -70,18 +70,15 @@ int main(int argc, char **argv) + fprintf(stderr, "%s: Missing fdt file\n", *argv); + usage(*argv); + } +- if (!keyfile) { +- fprintf(stderr, "%s: Missing key file\n", *argv); +- usage(*argv); +- } + + ffd = mmap_fdt(cmdname, fdtfile, 0, &fit_blob, &fsbuf, false, true); + if (ffd < 0) + return EXIT_FAILURE; +- kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true); +- if (kfd < 0) +- return EXIT_FAILURE; +- ++ if (keyfile) { ++ kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true); ++ if (kfd < 0) ++ return EXIT_FAILURE; ++ } + image_set_host_blob(key_blob); + ret = fit_check_sign(fit_blob, key_blob, config_name); + if (!ret) { +@@ -93,7 +90,9 @@ int main(int argc, char **argv) + } + + (void) munmap((void *)fit_blob, fsbuf.st_size); +- (void) munmap((void *)key_blob, ksbuf.st_size); ++ ++ if (keyfile) ++ (void) munmap((void *)key_blob, ksbuf.st_size); + + close(ffd); + close(kfd); diff --git a/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch b/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch new file mode 100644 index 0000000000..8f4dfefde2 --- /dev/null +++ b/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch @@ -0,0 +1,13 @@ +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -83,8 +83,8 @@ HOSTCFLAGS_img2srec.o := -pedantic + hostprogs-y += mkenvimage + mkenvimage-objs := mkenvimage.o os_support.o generated/lib/crc32.o + +-hostprogs-y += dumpimage mkimage +-hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info fit_check_sign ++hostprogs-y += dumpimage mkimage fit_check_sign ++hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info + hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fdt_add_pubkey + + ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST)$(CONFIG_FWU_MDATA_GPT_BLK),) From 0991d2f06d09f0aa5788e099e3cec15c9043bcb5 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sat, 15 Mar 2025 12:14:12 +0100 Subject: [PATCH 05/21] generic: rename backport patches to names containing version Rename 770-net-introduce-napi_is_scheduled-helper.patch to 770-v6.7-net-introduce-napi_is_scheduled-helper.patch because it is used since kernel 6.7 (https://lore.kernel.org/lkml/20231028011741.2400327-1-kuba@kernel.org/). Link: https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.7.y&id=7f3eb2174512fe6c9c0f062e96eccb0d3cc6d5cd Rename 751-01-STABLE-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch to 751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch because it is used since kernel 6.8.12 (https://lore.kernel.org/lkml/2024053036-matron-confess-13e0@gregkh/). Link: https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.8.y&id=b411384df5814fe6fd861d4869607577bcec73a1 Rename 751-02-STABLE-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch to 751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch because it is used since kernel 6.8.12 (https://lore.kernel.org/lkml/2024053036-matron-confess-13e0@gregkh/). Link: https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.8.y&id=0849f56b5146b70f2da328b1d178d0a3c53d6846 Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18253 Signed-off-by: Hauke Mehrtens --- ....8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch} | 0 ....8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch} | 0 ...atch => 770-v6.7-net-introduce-napi_is_scheduled-helper.patch} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/generic/backport-6.6/{751-01-STABLE-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch => 751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch} (100%) rename target/linux/generic/backport-6.6/{751-02-STABLE-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch => 751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch} (100%) rename target/linux/generic/backport-6.6/{770-net-introduce-napi_is_scheduled-helper.patch => 770-v6.7-net-introduce-napi_is_scheduled-helper.patch} (100%) diff --git a/target/linux/generic/backport-6.6/751-01-STABLE-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch b/target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch similarity index 100% rename from target/linux/generic/backport-6.6/751-01-STABLE-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch rename to target/linux/generic/backport-6.6/751-01-v6.8-net-ethernet-mediatek-split-tx-and-rx-fields-in-mtk_.patch diff --git a/target/linux/generic/backport-6.6/751-02-STABLE-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch b/target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch similarity index 100% rename from target/linux/generic/backport-6.6/751-02-STABLE-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch rename to target/linux/generic/backport-6.6/751-02-v6.8-net-ethernet-mediatek-use-QDMA-instead-of-ADMAv2-on-.patch diff --git a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch b/target/linux/generic/backport-6.6/770-v6.7-net-introduce-napi_is_scheduled-helper.patch similarity index 100% rename from target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch rename to target/linux/generic/backport-6.6/770-v6.7-net-introduce-napi_is_scheduled-helper.patch From a81099bca25fc6a6476d55f0ca8fa1d3f5e458e4 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 16 Mar 2025 17:30:37 +0100 Subject: [PATCH 06/21] generic: rename backport patch 752-03 to name with correct version Rename 752-03-v6.6-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch to 752-03-v6.7-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch because it is used since kernel 6.7 (https://lore.kernel.org/lkml/20231028011741.2400327-1-kuba@kernel.org/). Link: https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.7.y&id=5c33c09c89789ea45d2aac2471a28c9f90b04c95 Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18253 Signed-off-by: Hauke Mehrtens --- ....7-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename target/linux/generic/backport-6.6/{752-03-v6.6-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch => 752-03-v6.7-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch} (100%) diff --git a/target/linux/generic/backport-6.6/752-03-v6.6-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch b/target/linux/generic/backport-6.6/752-03-v6.7-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch similarity index 100% rename from target/linux/generic/backport-6.6/752-03-v6.6-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch rename to target/linux/generic/backport-6.6/752-03-v6.7-net-ethernet-mtk_eth_soc-rely-on-mtk_pse_port-defini.patch From 27e25d3401cc87e42ade0215df5bd3b17ef2d83f Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Mon, 17 Mar 2025 08:33:33 +0100 Subject: [PATCH 07/21] generic: move backport patches 751-03 and 751-04 to pending Patches 751-03 and 751-04 as a result of commit 6407ef8d2bcb4a0a6284de09cd77bd1868c1d6ea were incorrectly placed in the backport folder. So they return to their proper place. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18253 Signed-off-by: Hauke Mehrtens --- ..._wed-introduce-partial-AMSDU-offload.patch | 6 +++--- ..._eth_soc-ppe-add-support-for-multipl.patch | 2 +- ...eth_soc-improve-keeping-track-of-of.patch} | 18 ++++++++--------- ...atek-fix-ppe-flow-accounting-for-L2.patch} | 20 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) rename target/linux/generic/{backport-6.6/751-03-v6.4-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch => pending-6.6/736-03-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch} (94%) rename target/linux/generic/{backport-6.6/751-04-v6.4-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch => pending-6.6/736-04-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch} (94%) diff --git a/target/linux/generic/backport-6.6/752-16-v6.7-net-ethernet-mtk_wed-introduce-partial-AMSDU-offload.patch b/target/linux/generic/backport-6.6/752-16-v6.7-net-ethernet-mtk_wed-introduce-partial-AMSDU-offload.patch index 4e72ea128a..cc4baecdfb 100644 --- a/target/linux/generic/backport-6.6/752-16-v6.7-net-ethernet-mtk_wed-introduce-partial-AMSDU-offload.patch +++ b/target/linux/generic/backport-6.6/752-16-v6.7-net-ethernet-mtk_wed-introduce-partial-AMSDU-offload.patch @@ -15,7 +15,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c -@@ -439,7 +439,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e +@@ -425,7 +425,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e } int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, @@ -25,7 +25,7 @@ Signed-off-by: Paolo Abeni { struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); u32 *ib2 = mtk_foe_entry_ib2(eth, entry); -@@ -451,6 +452,7 @@ int mtk_foe_entry_set_wdma(struct mtk_et +@@ -437,6 +438,7 @@ int mtk_foe_entry_set_wdma(struct mtk_et MTK_FOE_IB2_WDMA_WINFO_V2; l2->w3info = FIELD_PREP(MTK_FOE_WINFO_WCID_V3, wcid) | FIELD_PREP(MTK_FOE_WINFO_BSS_V3, bss); @@ -65,7 +65,7 @@ Signed-off-by: Paolo Abeni }; /* software-only entry type */ -@@ -394,7 +394,8 @@ int mtk_foe_entry_set_vlan(struct mtk_et +@@ -392,7 +392,8 @@ int mtk_foe_entry_set_vlan(struct mtk_et int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry, int sid); int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, diff --git a/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch index 07e7e86340..789b363cef 100644 --- a/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch +++ b/target/linux/generic/backport-6.6/752-26-v6.10-net-ethernet-mtk_eth_soc-ppe-add-support-for-multipl.patch @@ -358,7 +358,7 @@ Signed-off-by: Jakub Kicinski } else { return -EOPNOTSUPP; } -@@ -630,7 +641,9 @@ int mtk_eth_setup_tc(struct net_device * +@@ -633,7 +644,9 @@ int mtk_eth_setup_tc(struct net_device * } } diff --git a/target/linux/generic/backport-6.6/751-03-v6.4-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch b/target/linux/generic/pending-6.6/736-03-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch similarity index 94% rename from target/linux/generic/backport-6.6/751-03-v6.4-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch rename to target/linux/generic/pending-6.6/736-03-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch index 2689712228..632133c408 100644 --- a/target/linux/generic/backport-6.6/751-03-v6.4-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch +++ b/target/linux/generic/pending-6.6/736-03-net-ethernet-mtk_eth_soc-improve-keeping-track-of-of.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c -@@ -477,42 +477,43 @@ int mtk_foe_entry_set_queue(struct mtk_e +@@ -479,42 +479,43 @@ int mtk_foe_entry_set_queue(struct mtk_e return 0; } @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, entry->hash); hwe->ib1 &= ~MTK_FOE_IB1_STATE; -@@ -533,7 +534,8 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp +@@ -535,7 +536,8 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp if (entry->type != MTK_FLOW_TYPE_L2_SUBFLOW) return; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau kfree(entry); } -@@ -549,66 +551,55 @@ static int __mtk_foe_entry_idle_time(str +@@ -551,66 +553,55 @@ static int __mtk_foe_entry_idle_time(str return now - timestamp; } @@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau } static void -@@ -651,7 +642,8 @@ __mtk_foe_entry_commit(struct mtk_ppe *p +@@ -653,7 +644,8 @@ __mtk_foe_entry_commit(struct mtk_ppe *p void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry) { spin_lock_bh(&ppe_lock); @@ -191,7 +191,7 @@ Signed-off-by: Felix Fietkau spin_unlock_bh(&ppe_lock); } -@@ -698,8 +690,8 @@ mtk_foe_entry_commit_subflow(struct mtk_ +@@ -700,8 +692,8 @@ mtk_foe_entry_commit_subflow(struct mtk_ { const struct mtk_soc_data *soc = ppe->eth->soc; struct mtk_flow_entry *flow_info; @@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; int type; -@@ -707,30 +699,30 @@ mtk_foe_entry_commit_subflow(struct mtk_ +@@ -709,30 +701,30 @@ mtk_foe_entry_commit_subflow(struct mtk_ if (!flow_info) return; @@ -242,7 +242,7 @@ Signed-off-by: Felix Fietkau } void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash) -@@ -740,9 +732,11 @@ void __mtk_ppe_check_skb(struct mtk_ppe +@@ -742,9 +734,11 @@ void __mtk_ppe_check_skb(struct mtk_ppe struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, hash); struct mtk_flow_entry *entry; struct mtk_foe_bridge key = {}; @@ -254,7 +254,7 @@ Signed-off-by: Felix Fietkau u8 *tag; spin_lock_bh(&ppe_lock); -@@ -750,20 +744,14 @@ void __mtk_ppe_check_skb(struct mtk_ppe +@@ -752,20 +746,14 @@ void __mtk_ppe_check_skb(struct mtk_ppe if (FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) == MTK_FOE_STATE_BIND) goto out; @@ -281,7 +281,7 @@ Signed-off-by: Felix Fietkau continue; } -@@ -814,9 +802,17 @@ out: +@@ -816,9 +804,17 @@ out: int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry) { diff --git a/target/linux/generic/backport-6.6/751-04-v6.4-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch b/target/linux/generic/pending-6.6/736-04-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch similarity index 94% rename from target/linux/generic/backport-6.6/751-04-v6.4-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch rename to target/linux/generic/pending-6.6/736-04-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch index a93f80ac79..f80a8a4d28 100644 --- a/target/linux/generic/backport-6.6/751-04-v6.4-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch +++ b/target/linux/generic/pending-6.6/736-04-net-ethernet-mediatek-fix-ppe-flow-accounting-for-L2.patch @@ -86,7 +86,7 @@ Signed-off-by: Felix Fietkau } static void mtk_ppe_cache_clear(struct mtk_ppe *ppe) -@@ -520,14 +534,6 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp +@@ -522,14 +536,6 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID); dma_wmb(); mtk_ppe_cache_clear(ppe); @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau } entry->hash = 0xffff; -@@ -552,11 +558,14 @@ static int __mtk_foe_entry_idle_time(str +@@ -554,11 +560,14 @@ static int __mtk_foe_entry_idle_time(str } static bool @@ -117,7 +117,7 @@ Signed-off-by: Felix Fietkau int len; if (hash == 0xffff) -@@ -567,18 +576,35 @@ mtk_flow_entry_update(struct mtk_ppe *pp +@@ -569,18 +578,35 @@ mtk_flow_entry_update(struct mtk_ppe *pp memcpy(&foe, hwe, len); if (!mtk_flow_entry_match(ppe->eth, entry, &foe, len) || @@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau struct mtk_flow_entry *cur; struct hlist_node *tmp; int idle; -@@ -587,7 +613,9 @@ mtk_flow_entry_update_l2(struct mtk_ppe +@@ -589,7 +615,9 @@ mtk_flow_entry_update_l2(struct mtk_ppe hlist_for_each_entry_safe(cur, tmp, &entry->l2_flows, l2_list) { int cur_idle; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau __mtk_foe_entry_clear(ppe, entry, false); continue; } -@@ -602,10 +630,29 @@ mtk_flow_entry_update_l2(struct mtk_ppe +@@ -604,10 +632,29 @@ mtk_flow_entry_update_l2(struct mtk_ppe } } @@ -197,7 +197,7 @@ Signed-off-by: Felix Fietkau struct mtk_eth *eth = ppe->eth; u16 timestamp = mtk_eth_timestamp(eth); struct mtk_foe_entry *hwe; -@@ -636,6 +683,12 @@ __mtk_foe_entry_commit(struct mtk_ppe *p +@@ -638,6 +685,12 @@ __mtk_foe_entry_commit(struct mtk_ppe *p dma_wmb(); @@ -210,7 +210,7 @@ Signed-off-by: Felix Fietkau mtk_ppe_cache_clear(ppe); } -@@ -800,21 +853,6 @@ out: +@@ -802,21 +855,6 @@ out: spin_unlock_bh(&ppe_lock); } @@ -232,7 +232,7 @@ Signed-off-by: Felix Fietkau int mtk_ppe_prepare_reset(struct mtk_ppe *ppe) { if (!ppe) -@@ -842,32 +880,6 @@ int mtk_ppe_prepare_reset(struct mtk_ppe +@@ -844,32 +882,6 @@ int mtk_ppe_prepare_reset(struct mtk_ppe return mtk_ppe_wait_busy(ppe); } @@ -284,7 +284,7 @@ Signed-off-by: Felix Fietkau void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash); -@@ -396,9 +399,8 @@ int mtk_foe_entry_set_queue(struct mtk_e +@@ -397,9 +400,8 @@ int mtk_foe_entry_set_queue(struct mtk_e unsigned int queue); int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry); void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry); @@ -309,7 +309,7 @@ Signed-off-by: Felix Fietkau seq_printf(m, "%05x %s %7s", i, --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c -@@ -501,24 +501,21 @@ static int +@@ -516,24 +516,21 @@ static int mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f) { struct mtk_flow_entry *entry; From 9fb06f2c3c5d290c9d489100609220c283b6c41d Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Mon, 17 Mar 2025 21:37:04 +0100 Subject: [PATCH 08/21] firewall4: update to Git HEAD (2025-03-17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit b6e5157527d3 fw4: fix reading kernel version 42d3b3d4ca21 fw4: allow family any for ipsets not matching IP addresses edfdfc6df484 Revert "fw4: allow family any for ipsets not matching IP addresses" 97962771aa3c config: drop to-be-forwarded-nowhere packets on wans 00fc6943a297 init: remove unnecessary stop logic ad3cba79c192 fw4: allow family any for ipsets not matching IP addresses Signed-off-by: Mieczyslaw Nalewaj [fix PKG_MIRROR_HASH] Signed-off-by: Álvaro Fernández Rojas Link: https://github.com/openwrt/openwrt/pull/18283 Signed-off-by: Hauke Mehrtens --- package/network/config/firewall4/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/firewall4/Makefile b/package/network/config/firewall4/Makefile index 9b53349275..fd17785099 100644 --- a/package/network/config/firewall4/Makefile +++ b/package/network/config/firewall4/Makefile @@ -9,9 +9,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git -PKG_SOURCE_DATE:=2024-12-18 -PKG_SOURCE_VERSION:=18fc0ead19faf06b8ce7ec5be84957278e942dfa -PKG_MIRROR_HASH:=123d1b5d00cdbbfa77813b3eb694d00949171037a0fa26e6d36a75a37066ba48 +PKG_SOURCE_DATE:=2025-03-17 +PKG_SOURCE_VERSION:=b6e5157527d361f99ad52eaa6da273cb0f2dfd59 +PKG_MIRROR_HASH:=fb563b493411922a8fbddf6a5a6766cffa47f87621e056b8dcf38309091835eb PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From b6ff3d9afa0ff8e9ae68812ac7aa6f9be168db95 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Tue, 18 Mar 2025 17:40:19 +0100 Subject: [PATCH 09/21] kernel: modules: ixgbe,ixgbevf,i40e: remove unused settings and depends Remove settings and depends that are not used anywhere. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18291 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netdevices.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 5503bcf64d..d96108fdd4 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1146,7 +1146,6 @@ define KernelPackage/ixgbe TITLE:=Intel(R) 82598/82599 PCI-Express 10 Gigabit Ethernet support DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-ptp +kmod-hwmon-core +kmod-libphy +kmod-mdio-devres KCONFIG:=CONFIG_IXGBE \ - CONFIG_IXGBE_VXLAN=n \ CONFIG_IXGBE_HWMON=y \ CONFIG_IXGBE_DCA=n \ CONFIG_IXGBE_DCB=y @@ -1166,7 +1165,6 @@ define KernelPackage/ixgbevf TITLE:=Intel(R) 82599 Virtual Function Ethernet support DEPENDS:=@PCI_SUPPORT +kmod-ixgbe KCONFIG:=CONFIG_IXGBEVF \ - CONFIG_IXGBE_VXLAN=n \ CONFIG_IXGBE_HWMON=y \ CONFIG_IXGBE_DCA=n FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko @@ -1183,11 +1181,8 @@ $(eval $(call KernelPackage,ixgbevf)) define KernelPackage/i40e SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Intel(R) Ethernet Controller XL710 Family support - DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-ptp +kmod-hwmon-core +kmod-libphy + DEPENDS:=@PCI_SUPPORT +kmod-ptp KCONFIG:=CONFIG_I40E \ - CONFIG_I40E_VXLAN=n \ - CONFIG_I40E_HWMON=y \ - CONFIG_I40E_DCA=n \ CONFIG_I40E_DCB=y FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/i40e/i40e.ko AUTOLOAD:=$(call AutoLoad,36,i40e,1) From cba55fade8f7d8aafbaf301b8dfbd3d9830830c5 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 30 Mar 2025 18:11:39 +0100 Subject: [PATCH 10/21] mediatek: restrict compat_version override for BPi-R3 Only force compat_version to 1.2 if it was less than 1.2 before, as changes 1.1 and 1.2 were bootloader-related and a completed boot indicates that the changes have been completed. Newer compat version 1.3 indicates a config change and should not be forced on boot. Fixes: 84fc59c0d5 ("mediatek: filogic: bpi-r3: set netdev-name for sfp1 port") Signed-off-by: Daniel Golle --- .../base-files/etc/uci-defaults/05_fix-compat-version | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version index f39d2575e1..d1ec1a6914 100644 --- a/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version @@ -2,8 +2,11 @@ case "$(board_name)" in bananapi,bpi-r3) - uci set system.@system[0].compat_version="1.2" - uci commit system + compat_version="$(uci get system.@system[0].compat_version)" + if [ "${compat_version%%.*}" = "1" ] && [ "${compat_version##*.}" -le 1 ]; then + uci set system.@system[0].compat_version="1.2" + uci commit system + fi ;; esac From 77be7175ae3617c893571700a8045cce3591f4fb Mon Sep 17 00:00:00 2001 From: Marius Durbaca Date: Mon, 31 Mar 2025 06:12:23 +0000 Subject: [PATCH 11/21] rampis: revert fix tplink_mr200v1 wan interface This reverts commit 7aa3dfdbda829c04475cffbd6708f1ff96e4849b. As the kernel is now fixed with https://github.com/openwrt/openwrt/commit/ecd609f509f29ed1f75db5c7a623f359c64efb72 Signed-off-by: Marius Durbaca Link: https://github.com/openwrt/openwrt/pull/18380 Signed-off-by: Robert Marko --- target/linux/ramips/mt7620/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 350743e941..57db30b923 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -247,7 +247,7 @@ ramips_setup_interfaces() tplink,archer-mr200) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" - ucidef_set_interface_wan "eth1" + ucidef_set_interface_wan "usb0" ;; tplink,ec220-g5-v2) ucidef_add_switch "switch0" From b47cf6e2db8ea5535350f2b7368ebae66fc749c9 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 29 Mar 2025 00:00:50 +0800 Subject: [PATCH 12/21] ath10k-ct: update to version 6.14 This new version fixes some memory leak and NULL pointer issues. Upstreamed patches: [1] 010-api_update.patch [2] 201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch The new 003 patch was introduced to fix the build error on old LTS kernel. The patch 004 was used to fix the issue of IPQ4019 radio not being able to start. Tested on QCA9882 and IPQ4019. [1] https://github.com/torvalds/linux/commit/bca8bc0399ac2efd56e6adbed0307e10125a556c [2] https://github.com/torvalds/linux/commit/8e1debd82466a3fe711784ab37e6b54e56011267 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18368 Signed-off-by: Robert Marko --- package/kernel/ath10k-ct/Makefile | 12 +- .../ath10k-ct/patches/001-patch-version.patch | 6 +- ...h10k-6.10-remove-unsupported-feature.patch | 6 +- ...t-compatible-with-the-old-LTS-kernel.patch | 46 ++ ...ath10k-Use-iommu_paging_domain_alloc.patch | 28 + .../ath10k-ct/patches/010-api_update.patch | 42 -- ...k-read-qcom-coexist-support-as-a-u32.patch | 6 +- ...LED-and-GPIO-controlling-support-for.patch | 616 ------------------ ...02-ath10k-use-tpt-trigger-by-default.patch | 20 +- .../300-fix-fortify-checking-error.patch | 4 +- ...0-0010-ath10k-limit-htt-rx-ring-size.patch | 4 +- ...60-0011-ath10k-limit-pci-buffer-size.patch | 4 +- ...k-always-use-mac80211-loss-detection.patch | 8 +- 13 files changed, 109 insertions(+), 693 deletions(-) create mode 100644 package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch create mode 100644 package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch delete mode 100644 package/kernel/ath10k-ct/patches/010-api_update.patch delete mode 100644 package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index f9795d8c8d..dfe1602449 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,21 +1,21 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-07-30 -PKG_SOURCE_VERSION:=ac71b14dc93aef0af6f0f24808b0afb673eaa5f5 -PKG_MIRROR_HASH:=f7774fc7002bbea450f543927acd528fb1bb6742f0e9ef28a402df3796893d93 +PKG_SOURCE_DATE:=2025-03-14 +PKG_SOURCE_VERSION:=63f5b605236f2cd2f919539d67236c43fb8f957d +PKG_MIRROR_HASH:=d83cb59b947680d40006e0da825735c387c5b1699a7981c2d973ca4d285266f2 -# Build the 6.10 ath10k-ct driver version. +# Build the 6.14 ath10k-ct driver version. # Probably this should match as closely as # possible to whatever mac80211 backports version is being used. -CT_KVER="-6.10" +CT_KVER="-6.14" PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/ath10k-ct/patches/001-patch-version.patch b/package/kernel/ath10k-ct/patches/001-patch-version.patch index 4c90a3f316..9cea32e639 100644 --- a/package/kernel/ath10k-ct/patches/001-patch-version.patch +++ b/package/kernel/ath10k-ct/patches/001-patch-version.patch @@ -1,11 +1,11 @@ ---- a/ath10k-6.10/pci.c -+++ b/ath10k-6.10/pci.c +--- a/ath10k-6.14/pci.c ++++ b/ath10k-6.14/pci.c @@ -3871,7 +3871,7 @@ static int __ath10k_pci_probe(struct pci int (*pci_hard_reset)(struct ath10k *ar); u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr); - printk(KERN_INFO "ath10k 6.7 driver, optimized for CT firmware, probing pci device: 0x%x.\n", -+ printk(KERN_INFO "ath10k 6.10 driver, optimized for CT firmware, probing pci device: 0x%x.\n", ++ printk(KERN_INFO "ath10k 6.14 driver, optimized for CT firmware, probing pci device: 0x%x.\n", pci_dev->device); switch (pci_dev->device) { diff --git a/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch b/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch index ca64c8a110..f7caa52603 100644 --- a/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch +++ b/package/kernel/ath10k-ct/patches/002-ath10k-6.10-remove-unsupported-feature.patch @@ -1,6 +1,6 @@ ---- a/ath10k-6.10/mac.c -+++ b/ath10k-6.10/mac.c -@@ -11626,7 +11626,6 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -11648,7 +11648,6 @@ int ath10k_mac_register(struct ath10k *a ar->hw->wiphy->n_cipher_suites = ar->hw_params.n_cipher_suites; wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch b/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch new file mode 100644 index 0000000000..632a419258 --- /dev/null +++ b/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch @@ -0,0 +1,46 @@ +From: Shiji Yang +Date: Fri, 28 Mar 2025 19:56:06 +0800 +Subject: [PATCH] ath10k-ct: make it compatible with the old LTS kernel + +Rollback some APIs to fix compilation errors. + +Signed-off-by: Shiji Yang +--- + ath10k-6.14/ahb.c | 2 +- + ath10k-6.14/mac.c | 5 ++--- + 2 files changed, 3 insertions(+), 4 deletions(-) + +--- a/ath10k-6.14/ahb.c ++++ b/ath10k-6.14/ahb.c +@@ -842,7 +842,7 @@ static struct platform_driver ath10k_ahb + .of_match_table = ath10k_ahb_of_match, + }, + .probe = ath10k_ahb_probe, +- .remove = ath10k_ahb_remove, ++ .remove_new = ath10k_ahb_remove, + }; + + int ath10k_ahb_init(void) +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -9607,10 +9607,9 @@ exit: + + static void ath10k_sta_rc_update(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, +- struct ieee80211_link_sta *link_sta, ++ struct ieee80211_sta *sta, + u32 changed) + { +- struct ieee80211_sta *sta = link_sta->sta; + struct ath10k *ar = hw->priv; + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; + struct ath10k_vif *arvif = (void *)vif->drv_priv; +@@ -10603,7 +10602,7 @@ static const struct ieee80211_ops ath10k + .reconfig_complete = ath10k_reconfig_complete, + .get_survey = ath10k_get_survey, + .set_bitrate_mask = ath10k_mac_op_set_bitrate_mask, +- .link_sta_rc_update = ath10k_sta_rc_update, ++ .sta_rc_update = ath10k_sta_rc_update, + .offset_tsf = ath10k_offset_tsf, + .get_tsf = ath10k_get_tsf, + .ampdu_action = ath10k_ampdu_action, diff --git a/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch b/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch new file mode 100644 index 0000000000..f765950cad --- /dev/null +++ b/package/kernel/ath10k-ct/patches/004-Revert-wifi-ath10k-Use-iommu_paging_domain_alloc.patch @@ -0,0 +1,28 @@ +From: Shiji Yang +Date: Fri, 28 Mar 2025 19:56:06 +0800 +Subject: [PATCH] Revert "wifi: ath10k: Use iommu_paging_domain_alloc()" + +IPQ4019 wireless can't start after upstream commit d5b7485588df[1]. + +[1] https://github.com/torvalds/linux/commit/d5b7485588dffb39c5687e965623124ab7ebcd51 +Signed-off-by: Shiji Yang +--- + ath10k-6.14/snoc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/ath10k-6.14/snoc.c ++++ b/ath10k-6.14/snoc.c +@@ -1635,10 +1635,10 @@ static int ath10k_fw_init(struct ath10k + + ar_snoc->fw.dev = &pdev->dev; + +- iommu_dom = iommu_paging_domain_alloc(ar_snoc->fw.dev); +- if (IS_ERR(iommu_dom)) { ++ iommu_dom = iommu_domain_alloc(&platform_bus_type); ++ if (!iommu_dom) { + ath10k_err(ar, "failed to allocate iommu domain\n"); +- ret = PTR_ERR(iommu_dom); ++ ret = -ENOMEM; + goto err_unregister; + } + diff --git a/package/kernel/ath10k-ct/patches/010-api_update.patch b/package/kernel/ath10k-ct/patches/010-api_update.patch deleted file mode 100644 index dff725b4e4..0000000000 --- a/package/kernel/ath10k-ct/patches/010-api_update.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/ath10k-6.10/mac.c -+++ b/ath10k-6.10/mac.c -@@ -1675,7 +1675,7 @@ static void ath10k_recalc_radar_detectio - * by indicating that radar was detected. - */ - ath10k_warn(ar, "failed to start CAC: %d\n", ret); -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - } - -@@ -6238,7 +6238,7 @@ err: - return ret; - } - --static void ath10k_stop(struct ieee80211_hw *hw) -+static void ath10k_stop(struct ieee80211_hw *hw, bool suspend) - { - struct ath10k *ar = hw->priv; - u32 opt; ---- a/ath10k-6.10/debug.c -+++ b/ath10k-6.10/debug.c -@@ -3319,7 +3319,7 @@ static ssize_t ath10k_write_simulate_rad - if (!arvif->is_started) - return -EINVAL; - -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - - return count; - } ---- a/ath10k-6.10/wmi.c -+++ b/ath10k-6.10/wmi.c -@@ -4402,7 +4402,7 @@ static void ath10k_radar_detected(struct - if (ar->dfs_block_radar_events) - ath10k_info(ar, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - - static void ath10k_radar_confirmation_work(struct work_struct *work) diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch index 61090a49d0..3bc31e0b84 100644 --- a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch +++ b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch @@ -39,9 +39,9 @@ that the feature is properly initialized: Signed-off-by: Vincent Tremblay ---- a/ath10k-6.10/core.c -+++ b/ath10k-6.10/core.c -@@ -2871,14 +2871,14 @@ done: +--- a/ath10k-6.14/core.c ++++ b/ath10k-6.14/core.c +@@ -2888,14 +2888,14 @@ done: static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar) { struct device_node *node; diff --git a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch deleted file mode 100644 index c1137d081e..0000000000 --- a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch +++ /dev/null @@ -1,616 +0,0 @@ -From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 -From: Sebastian Gottschall -Date: Mon, 13 May 2024 17:22:25 +0300 -Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for - various chipsets - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 -based chipsets with on chipset connected led's using WMI Firmware API. -The LED device will get available named as "ath10k-phyX" at sysfs and -can be controlled with various triggers. -Adds also debugfs interface for gpio control. - -Signed-off-by: Sebastian Gottschall -Reviewed-by: Steve deRosier -[kvalo: major reorg and cleanup] -Signed-off-by: Kalle Valo -[ansuel: rebase and small cleanup] -Signed-off-by: Christian Marangi -Tested-by: Stefan Lippers-Hollmann -Signed-off-by: Kalle Valo -Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com ---- - ath10k-6.10/Kconfig | 6 ++ - ath10k-6.10/Makefile | 1 + - ath10k-6.10/core.c | 32 ++++++++ - ath10k-6.10/core.h | 8 ++ - ath10k-6.10/hw.h | 1 + - ath10k-6.10/leds.c | 90 +++++++++++++++++++++++ - ath10k-6.10/leds.h | 34 +++++++++ - ath10k-6.10/mac.c | 1 + - ath10k-6.10/wmi-ops.h | 32 ++++++++ - ath10k-6.10/wmi-tlv.c | 2 + - ath10k-6.10/wmi.c | 54 ++++++++++++++ - ath10k-6.10/wmi.h | 35 +++++++++ - 12 files changed, 296 insertions(+) - create mode 100644 ath10k-6.10/leds.c - create mode 100644 ath10k-6.10/leds.h - ---- a/ath10k-6.10/Kconfig -+++ b/ath10k-6.10/Kconfig -@@ -68,6 +68,12 @@ config ATH10K_DEBUGFS - - If unsure, say Y to make it easier to debug problems. - -+config ATH10K_LEDS -+ bool -+ depends on ATH10K -+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 -+ default y -+ - config ATH10K_SPECTRAL - bool "Atheros ath10k spectral scan support" - depends on ATH10K_DEBUGFS ---- a/ath10k-6.10/Makefile -+++ b/ath10k-6.10/Makefile -@@ -20,6 +20,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += - ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o - ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o - ath10k_core-$(CONFIG_THERMAL) += thermal.o -+ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o - ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o - ath10k_core-$(CONFIG_PM) += wow.o - ath10k_core-$(CONFIG_ATH10K_CE) += ce.o ---- a/ath10k-6.10/core.c -+++ b/ath10k-6.10/core.c -@@ -29,6 +29,7 @@ - #include "testmode.h" - #include "wmi-ops.h" - #include "coredump.h" -+#include "leds.h" - - /* Disable ath10k-ct DBGLOG output by default */ - unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG; -@@ -81,6 +82,7 @@ static const struct ath10k_hw_params ath - .name = "qca988x hw2.0", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -121,6 +123,7 @@ static const struct ath10k_hw_params ath - .name = "qca988x hw2.0 ubiquiti", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -162,6 +165,7 @@ static const struct ath10k_hw_params ath - .name = "qca9887 hw1.0", - .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -203,6 +207,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2 sdio", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -239,6 +244,7 @@ static const struct ath10k_hw_params ath - .name = "qca6164 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -279,6 +285,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -319,6 +326,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.0", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -359,6 +367,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -403,6 +412,7 @@ static const struct ath10k_hw_params ath - .name = "qca99x0 hw2.0", - .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, - .cck_rate_map_rev2 = true, -@@ -449,6 +459,7 @@ static const struct ath10k_hw_params ath - .name = "qca9984/qca9994 hw1.0", - .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -501,6 +512,7 @@ static const struct ath10k_hw_params ath - .name = "qca9888 hw2.0", - .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -551,6 +563,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.0", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -591,6 +604,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -633,6 +647,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1 sdio", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -666,6 +681,7 @@ static const struct ath10k_hw_params ath - .name = "qca4019 hw1.0", - .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x0010000, - .continuous_frag_desc = true, -@@ -711,6 +727,7 @@ static const struct ath10k_hw_params ath - .dev_id = 0, - .bus = ATH10K_BUS_SNOC, - .name = "wcn3990 hw1.0", -+ .led_pin = 0, - .continuous_frag_desc = true, - .tx_chain_mask = 0x7, - .rx_chain_mask = 0x7, -@@ -4073,6 +4090,10 @@ int ath10k_core_start(struct ath10k *ar, - ath10k_wmi_check_apply_board_power_ctl_table(ar); - } - -+ status = ath10k_leds_start(ar); -+ if (status) -+ goto err_hif_stop; -+ - return 0; - - err_hif_stop: -@@ -4334,9 +4355,18 @@ static void ath10k_core_register_work(st - goto err_spectral_destroy; - } - -+ status = ath10k_leds_register(ar); -+ if (status) { -+ ath10k_err(ar, "could not register leds: %d\n", -+ status); -+ goto err_thermal_unregister; -+ } -+ - set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags); - return; - -+err_thermal_unregister: -+ ath10k_thermal_unregister(ar); - err_spectral_destroy: - ath10k_spectral_destroy(ar); - err_debug_destroy: -@@ -4396,6 +4426,8 @@ void ath10k_core_unregister(struct ath10 - if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) - return; - -+ ath10k_leds_unregister(ar); -+ - ath10k_thermal_unregister(ar); - /* Stop spectral before unregistering from mac80211 to remove the - * relayfs debugfs file cleanly. Otherwise the parent debugfs tree ---- a/ath10k-6.10/core.h -+++ b/ath10k-6.10/core.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "htt.h" - #include "htc.h" -@@ -1592,6 +1593,13 @@ struct ath10k { - } testmode; - - struct { -+ struct gpio_led wifi_led; -+ struct led_classdev cdev; -+ char label[48]; -+ u32 gpio_state_pin; -+ } leds; -+ -+ struct { - /* protected by data_lock */ - u32 rx_crc_err_drop; - u32 fw_crash_counter; ---- a/ath10k-6.10/hw.h -+++ b/ath10k-6.10/hw.h -@@ -516,6 +516,7 @@ struct ath10k_hw_params { - const char *name; - u32 patch_load_addr; - int uart_pin; -+ int led_pin; - u32 otp_exe_param; - - /* Type of hw cycle counter wraparound logic, for more info ---- /dev/null -+++ b/ath10k-6.10/leds.c -@@ -0,0 +1,90 @@ -+// SPDX-License-Identifier: ISC -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+ -+#include "core.h" -+#include "wmi.h" -+#include "wmi-ops.h" -+ -+#include "leds.h" -+ -+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev, -+ enum led_brightness brightness) -+{ -+ struct ath10k *ar = container_of(led_cdev, struct ath10k, -+ leds.cdev); -+ struct gpio_led *led = &ar->leds.wifi_led; -+ -+ mutex_lock(&ar->conf_mutex); -+ -+ if (ar->state != ATH10K_STATE_ON) -+ goto out; -+ -+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low; -+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin); -+ -+out: -+ mutex_unlock(&ar->conf_mutex); -+ -+ return 0; -+} -+ -+int ath10k_leds_start(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ /* under some circumstances, the gpio pin gets reconfigured -+ * to default state by the firmware, so we need to -+ * reconfigure it this behaviour has only ben seen on -+ * QCA9984 and QCA99XX devices so far -+ */ -+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0, -+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE); -+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1); -+ -+ return 0; -+} -+ -+int ath10k_leds_register(struct ath10k *ar) -+{ -+ int ret; -+ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s", -+ wiphy_name(ar->hw->wiphy)); -+ ar->leds.wifi_led.active_low = 1; -+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin; -+ ar->leds.wifi_led.name = ar->leds.label; -+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP; -+ -+ ar->leds.cdev.name = ar->leds.label; -+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; -+ -+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+void ath10k_leds_unregister(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return; -+ -+ led_classdev_unregister(&ar->leds.cdev); -+} -+ ---- /dev/null -+++ b/ath10k-6.10/leds.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: ISC */ -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#ifndef _LEDS_H_ -+#define _LEDS_H_ -+ -+#include "core.h" -+ -+#ifdef CONFIG_ATH10K_LEDS -+void ath10k_leds_unregister(struct ath10k *ar); -+int ath10k_leds_start(struct ath10k *ar); -+int ath10k_leds_register(struct ath10k *ar); -+#else -+static inline void ath10k_leds_unregister(struct ath10k *ar) -+{ -+} -+ -+static inline int ath10k_leds_start(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+static inline int ath10k_leds_register(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+#endif -+#endif /* _LEDS_H_ */ ---- a/ath10k-6.10/mac.c -+++ b/ath10k-6.10/mac.c -@@ -26,6 +26,7 @@ - #include "wmi-tlv.h" - #include "wmi-ops.h" - #include "wow.h" -+#include "leds.h" - - /*********/ - /* Rates */ ---- a/ath10k-6.10/wmi-ops.h -+++ b/ath10k-6.10/wmi-ops.h -@@ -228,7 +228,10 @@ struct wmi_ops { - const struct wmi_bb_timing_cfg_arg *arg); - struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, - const struct wmi_per_peer_per_tid_cfg_arg *arg); -+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode); - -+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set); - }; - - int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); -@@ -1147,6 +1150,35 @@ ath10k_wmi_force_fw_hang(struct ath10k * - return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); - } - -+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid); -+} -+ -+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid); -+} -+ - static inline int - ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) - { ---- a/ath10k-6.10/wmi-tlv.c -+++ b/ath10k-6.10/wmi-tlv.c -@@ -4606,6 +4606,8 @@ static const struct wmi_ops wmi_tlv_ops - .gen_echo = ath10k_wmi_tlv_op_gen_echo, - .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, - .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, -+ /* .gen_gpio_config not implemented */ -+ /* .gen_gpio_output not implemented */ - }; - - static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { ---- a/ath10k-6.10/wmi.c -+++ b/ath10k-6.10/wmi.c -@@ -8467,6 +8467,49 @@ ath10k_wmi_op_gen_peer_set_param(struct - return skb; - } - -+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar, -+ u32 gpio_num, u32 input, -+ u32 pull_type, u32 intr_mode) -+{ -+ struct wmi_gpio_config_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_config_cmd *)skb->data; -+ cmd->pull_type = __cpu_to_le32(pull_type); -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->input = __cpu_to_le32(input); -+ cmd->intr_mode = __cpu_to_le32(intr_mode); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n", -+ gpio_num, input, pull_type, intr_mode); -+ -+ return skb; -+} -+ -+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar, -+ u32 gpio_num, u32 set) -+{ -+ struct wmi_gpio_output_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_output_cmd *)skb->data; -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->set = __cpu_to_le32(set); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n", -+ gpio_num, set); -+ -+ return skb; -+} -+ - static struct sk_buff * - ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, - enum wmi_sta_ps_mode psmode) -@@ -10274,6 +10317,9 @@ static const struct wmi_ops wmi_ops = { - .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, -+ - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10344,6 +10390,8 @@ static const struct wmi_ops wmi_10_1_ops - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10423,6 +10471,8 @@ static const struct wmi_ops wmi_10_2_ops - .gen_delba_send = ath10k_wmi_op_gen_delba_send, - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_pdev_enable_adaptive_cca not implemented */ - }; - -@@ -10494,6 +10544,8 @@ static const struct wmi_ops wmi_10_2_4_o - ath10k_wmi_op_gen_pdev_enable_adaptive_cca, - .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, - .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10576,6 +10628,8 @@ static const struct wmi_ops wmi_10_4_ops - .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, - .gen_echo = ath10k_wmi_op_gen_echo, - .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - }; - - int ath10k_wmi_attach(struct ath10k *ar) ---- a/ath10k-6.10/wmi.h -+++ b/ath10k-6.10/wmi.h -@@ -3137,6 +3137,41 @@ enum wmi_10_4_feature_mask { - - }; - -+/* WMI_GPIO_CONFIG_CMDID */ -+enum { -+ WMI_GPIO_PULL_NONE, -+ WMI_GPIO_PULL_UP, -+ WMI_GPIO_PULL_DOWN, -+}; -+ -+enum { -+ WMI_GPIO_INTTYPE_DISABLE, -+ WMI_GPIO_INTTYPE_RISING_EDGE, -+ WMI_GPIO_INTTYPE_FALLING_EDGE, -+ WMI_GPIO_INTTYPE_BOTH_EDGE, -+ WMI_GPIO_INTTYPE_LEVEL_LOW, -+ WMI_GPIO_INTTYPE_LEVEL_HIGH -+}; -+ -+/* WMI_GPIO_CONFIG_CMDID */ -+struct wmi_gpio_config_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 input; /* 0 - Output/ 1 - Input */ -+ __le32 pull_type; /* Pull type defined above */ -+ __le32 intr_mode; /* Interrupt mode defined above (Input) */ -+} __packed; -+ -+/* WMI_GPIO_OUTPUT_CMDID */ -+struct wmi_gpio_output_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 set; /* Set the GPIO pin*/ -+} __packed; -+ -+/* WMI_GPIO_INPUT_EVENTID */ -+struct wmi_gpio_input_event { -+ __le32 gpio_num; /* GPIO number which changed state */ -+} __packed; -+ - struct wmi_ext_resource_config_10_4_cmd { - /* contains enum wmi_host_platform_type */ - __le32 host_platform_config; diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index cd1d300b38..34dd2101b9 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -9,13 +9,13 @@ traffic. Signed-off-by: Mathias Kresin --- - ath10k-6.7/core.h | 4 ++++ - ath10k-6.7/leds.c | 4 +--- - ath10k-6.7/mac.c | 2 +- + ath10k-6.14/core.h | 4 ++++ + ath10k-6.14/leds.c | 4 +--- + ath10k-6.14/mac.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) ---- a/ath10k-6.10/core.h -+++ b/ath10k-6.10/core.h +--- a/ath10k-6.14/core.h ++++ b/ath10k-6.14/core.h @@ -1707,6 +1707,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -27,8 +27,8 @@ Signed-off-by: Mathias Kresin /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); }; ---- a/ath10k-6.10/leds.c -+++ b/ath10k-6.10/leds.c +--- a/ath10k-6.14/leds.c ++++ b/ath10k-6.14/leds.c @@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; @@ -38,9 +38,9 @@ Signed-off-by: Mathias Kresin ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); if (ret) ---- a/ath10k-6.10/mac.c -+++ b/ath10k-6.10/mac.c -@@ -11631,7 +11631,7 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -11651,7 +11651,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch index 89921d6a34..84a74c0d3e 100644 --- a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch +++ b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.10/wmi.h -+++ b/ath10k-6.10/wmi.h +--- a/ath10k-6.14/wmi.h ++++ b/ath10k-6.14/wmi.h @@ -6310,7 +6310,7 @@ struct qca9880_set_ctl_table_cmd { __le32 ctl_len; /* in bytes. This may be ignored in firmware, * make sure ctl_info data is sizeof(qca9880_power_ctl) */ diff --git a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch index bd25222e1d..31a5161c0a 100644 --- a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.10/htt.h -+++ b/ath10k-6.10/htt.h +--- a/ath10k-6.14/htt.h ++++ b/ath10k-6.14/htt.h @@ -238,7 +238,11 @@ enum htt_rx_ring_flags { }; diff --git a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch index 708a7caea2..6490e3ca9b 100644 --- a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.10/pci.c -+++ b/ath10k-6.10/pci.c +--- a/ath10k-6.14/pci.c ++++ b/ath10k-6.14/pci.c @@ -132,7 +132,11 @@ static const struct ce_attr pci_host_ce_ .flags = CE_ATTR_FLAGS, .src_nentries = 0, diff --git a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch index 35026cc0f9..3729e0f323 100644 --- a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch @@ -13,12 +13,12 @@ own loss detection mechanism. Signed-off-by: David Bauer --- - ath10k-6.10/mac.c | 1 - + ath10k-6.14/mac.c | 1 - 1 file changed, 1 deletion(-) ---- a/ath10k-6.10/mac.c -+++ b/ath10k-6.10/mac.c -@@ -11316,7 +11316,6 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -11336,7 +11336,6 @@ int ath10k_mac_register(struct ath10k *a ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA); ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); From 88234a03bc645d327016cc807c35972fcb6834eb Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 29 Mar 2025 00:00:50 +0800 Subject: [PATCH 13/21] ath10k-ct: silence some harmless noisy logs Users feel anxious about some ath10k driver logs. After further investigation, in fact these logs are harmless. Only developers need to care about them in order to optimize some parameters. Let's just silence them to reduce these similar user reports. Closes: https://github.com/openwrt/openwrt/issues/13148 Closes: https://github.com/openwrt/openwrt/issues/14422 Closes: https://github.com/openwrt/openwrt/issues/15959 Closes: https://github.com/openwrt/openwrt/issues/15997 Closes: https://github.com/openwrt/openwrt/issues/16896 Closes: https://github.com/openwrt/openwrt/issues/18046 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18368 Signed-off-by: Robert Marko --- ...e-warning-caused-by-unsupported-retr.patch | 34 +++++++++++++++++++ ...e-noisy-log-caused-by-flushing-queue.patch | 31 +++++++++++++++++ ...k-always-use-mac80211-loss-detection.patch | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 package/kernel/ath10k-ct/patches/205-ath10k-ct-silence-warning-caused-by-unsupported-retr.patch create mode 100644 package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch diff --git a/package/kernel/ath10k-ct/patches/205-ath10k-ct-silence-warning-caused-by-unsupported-retr.patch b/package/kernel/ath10k-ct/patches/205-ath10k-ct-silence-warning-caused-by-unsupported-retr.patch new file mode 100644 index 0000000000..202728d563 --- /dev/null +++ b/package/kernel/ath10k-ct/patches/205-ath10k-ct-silence-warning-caused-by-unsupported-retr.patch @@ -0,0 +1,34 @@ +From: Shiji Yang +Date: Fri, 28 Mar 2025 20:26:04 +0800 +Subject: [PATCH] ath10k-ct: silence warning caused by unsupported retry_limit + value + +Some retry_limit values are not supported by ath10k wave2 chips. +We can just skip config it for these chips. And it's safe to +return 0 in this case because the hardware is still working. + +Suggested-by: Ben Greear +Signed-off-by: Shiji Yang +--- + ath10k-6.14/mac.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -5401,7 +5401,7 @@ static int ath10k_config_retry_limit(str + */ + ath10k_warn(ar, "Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: %d\n", + limit); +- return -EINVAL; ++ goto skip_retry_limit; + } + + list_for_each_entry(arvif, &ar->arvifs, list) { +@@ -5412,6 +5412,7 @@ static int ath10k_config_retry_limit(str + } + } + ++skip_retry_limit: + return ret; + } + diff --git a/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch b/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch new file mode 100644 index 0000000000..2f6db1dd2a --- /dev/null +++ b/package/kernel/ath10k-ct/patches/206-ath10k-ct-silence-noisy-log-caused-by-flushing-queue.patch @@ -0,0 +1,31 @@ +From: Shiji Yang +Date: Fri, 28 Mar 2025 21:02:27 +0800 +Subject: [PATCH] ath10k-ct: silence noisy log caused by flushing queue + +.flush() is a regular mac80211 operation aims to clear all pending +frames from the hardware queue. Only developers need to care about it. + +Signed-off-by: Shiji Yang +--- + ath10k-6.14/mac.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/ath10k-6.14/mac.c ++++ b/ath10k-6.14/mac.c +@@ -9081,12 +9081,12 @@ static void ath10k_flush(struct ieee8021 + if (vif) { + arvif = (void *)vif->drv_priv; + vid = arvif->vdev_id; +- ath10k_info(ar, "mac flush vdev %d drop %d queues 0x%x ar->paused: 0x%lx arvif->paused: 0x%lx\n", +- arvif->vdev_id, drop, queues, ar->tx_paused, arvif->tx_paused); ++ ath10k_dbg(ar, ATH10K_DBG_MAC, "mac flush vdev %d drop %d queues 0x%x ar->paused: 0x%lx arvif->paused: 0x%lx\n", ++ arvif->vdev_id, drop, queues, ar->tx_paused, arvif->tx_paused); + } + else { +- ath10k_info(ar, "mac flush null vif, drop %d queues 0x%x\n", +- drop, queues); ++ ath10k_dbg(ar, ATH10K_DBG_MAC, "mac flush null vif, drop %d queues 0x%x\n", ++ drop, queues); + } + + diff --git a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch index 3729e0f323..665581e4ab 100644 --- a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch @@ -18,7 +18,7 @@ Signed-off-by: David Bauer --- a/ath10k-6.14/mac.c +++ b/ath10k-6.14/mac.c -@@ -11336,7 +11336,6 @@ int ath10k_mac_register(struct ath10k *a +@@ -11337,7 +11337,6 @@ int ath10k_mac_register(struct ath10k *a ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA); ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); From 324f234966fe7b910c7f25b69334e54591098c18 Mon Sep 17 00:00:00 2001 From: Qingfang Deng Date: Sun, 9 Mar 2025 02:00:14 +0800 Subject: [PATCH 14/21] kernel: Mediatek: fix EEE registers init After booting, a "transmit queue 0 timed out" warning followed by a register dump was observed. The dump indicates that mtk_hw_init() does not initialize the EEECR during probe. This occurs because the netdev is allocated in mtk_add_mac(), which is called after mtk_hw_init(). Consequently, the EEECR register remains uninitialized until a reset is triggered, causing mtk_hw_init() to run again with a valid netdev, at which point the register is finally set. To address this, instead of modifying the probe sequence, latch the Tx LPI enable state and timer value, and move the EEECR register initialization to mtk_mac_link_up() to ensure proper setup when the interface comes up. Additionally, the splat reveals that LPI functionality is controlled by the MAC_MCR_EEE bits in the MCR register. Update mtk_set_eee() to modify these bits accordingly. Fixes: d8315d5358d5 ("kernel: backport Mediatek SoC EEE support") Fixes: edddbaf79ccf ("kernel: Mediatek: set default EEE Tx LPI timer") Signed-off-by: Qingfang Deng --- ...et-ethernet-mediatek-add-EEE-support.patch | 57 ++++++++++++------- ..._eth_soc-add-hw-dump-for-forced-rese.patch | 4 +- ...net-mtk_eth_soc-enable-threaded-NAPI.patch | 2 +- ..._eth_soc-reset-all-TX-queues-on-DMA-.patch | 2 +- ..._eth_soc-compile-out-netsys-v2-code-.patch | 4 +- ..._eth_soc-work-around-issue-with-send.patch | 6 +- ...ernet-mtk_eth_soc-use-napi_build_skb.patch | 4 +- ...-mediatek-enlarge-DMA-reserve-buffer.patch | 2 +- ..._eth_soc-fix-memory-corruption-durin.patch | 2 +- ..._eth_soc-add-paths-and-SerDes-modes-.patch | 26 ++++----- ...th_soc-reduce-rx-ring-size-for-older.patch | 16 +++--- ..._eth_soc-do-not-enable-page-pool-sta.patch | 4 +- 12 files changed, 71 insertions(+), 58 deletions(-) diff --git a/target/linux/generic/backport-6.6/753-v6.15-net-ethernet-mediatek-add-EEE-support.patch b/target/linux/generic/backport-6.6/753-v6.15-net-ethernet-mediatek-add-EEE-support.patch index d9b86ae36e..b908d133b5 100644 --- a/target/linux/generic/backport-6.6/753-v6.15-net-ethernet-mediatek-add-EEE-support.patch +++ b/target/linux/generic/backport-6.6/753-v6.15-net-ethernet-mediatek-add-EEE-support.patch @@ -23,34 +23,23 @@ Signed-off-by: Qingfang Deng MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC | MAC_MCR_FORCE_RX_FC); -@@ -811,6 +812,18 @@ static void mtk_mac_link_up(struct phyli +@@ -811,6 +812,15 @@ static void mtk_mac_link_up(struct phyli if (rx_pause) mcr |= MAC_MCR_FORCE_RX_FC; -+ if (mode == MLO_AN_PHY && phy && phy_init_eee(phy, false) >= 0) { -+ switch (speed) { -+ case SPEED_2500: -+ case SPEED_1000: -+ mcr |= MAC_MCR_EEE1G; -+ break; -+ case SPEED_100: -+ mcr |= MAC_MCR_EEE100M; -+ break; -+ } ++ if (mode == MLO_AN_PHY && phy && mac->tx_lpi_enabled && phy_init_eee(phy, false) >= 0) { ++ mcr |= MAC_MCR_EEE100M | MAC_MCR_EEE1G; ++ mtk_w32(mac->hw, ++ FIELD_PREP(MAC_EEE_WAKEUP_TIME_1000, 17) | ++ FIELD_PREP(MAC_EEE_WAKEUP_TIME_100, 36) | ++ FIELD_PREP(MAC_EEE_LPI_TXIDLE_THD, mac->txidle_thd_ms), ++ MTK_MAC_EEECR(mac->id)); + } + mcr |= MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK; mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); } -@@ -3956,6 +3969,7 @@ static int mtk_hw_init(struct mtk_eth *e - continue; - - mtk_w32(eth, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(i)); -+ mtk_w32(eth, FIELD_PREP(MAC_EEE_LPI_TXIDLE_THD, 1), MTK_MAC_EEECR(i)); - mtk_set_mcr_max_rx(netdev_priv(dev), - dev->mtu + MTK_RX_ETH_HLEN); - } -@@ -4476,6 +4490,55 @@ static int mtk_set_pauseparam(struct net +@@ -4476,6 +4486,61 @@ static int mtk_set_pauseparam(struct net return phylink_ethtool_set_pauseparam(mac->phylink, pause); } @@ -65,7 +54,7 @@ Signed-off-by: Qingfang Deng + return ret; + + reg = mtk_r32(mac->hw, MTK_MAC_EEECR(mac->id)); -+ eee->tx_lpi_enabled = !(reg & MAC_EEE_LPI_MODE); ++ eee->tx_lpi_enabled = mac->tx_lpi_enabled; + eee->tx_lpi_timer = FIELD_GET(MAC_EEE_LPI_TXIDLE_THD, reg) * 1000; + + return 0; @@ -98,7 +87,13 @@ Signed-off-by: Qingfang Deng + if (ret) + return ret; + ++ mac->tx_lpi_enabled = eee->tx_lpi_enabled; ++ mac->txidle_thd_ms = txidle_thd_ms; + mtk_w32(mac->hw, reg, MTK_MAC_EEECR(mac->id)); ++ if (eee->eee_enabled && eee->eee_active && eee->tx_lpi_enabled) ++ mtk_m32(mac->hw, 0, MAC_MCR_EEE100M | MAC_MCR_EEE1G, MTK_MAC_MCR(mac->id)); ++ else ++ mtk_m32(mac->hw, MAC_MCR_EEE100M | MAC_MCR_EEE1G, 0, MTK_MAC_MCR(mac->id)); + + return 0; +} @@ -106,7 +101,7 @@ Signed-off-by: Qingfang Deng static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb, struct net_device *sb_dev) { -@@ -4508,6 +4571,8 @@ static const struct ethtool_ops mtk_etht +@@ -4508,6 +4573,8 @@ static const struct ethtool_ops mtk_etht .set_pauseparam = mtk_set_pauseparam, .get_rxnfc = mtk_get_rxnfc, .set_rxnfc = mtk_set_rxnfc, @@ -115,6 +110,15 @@ Signed-off-by: Qingfang Deng }; static const struct net_device_ops mtk_netdev_ops = { +@@ -4568,6 +4635,8 @@ static int mtk_add_mac(struct mtk_eth *e + } + mac = netdev_priv(eth->netdev[id]); + eth->mac[id] = mac; ++ mac->tx_lpi_enabled = true; ++ mac->txidle_thd_ms = 1; + mac->id = id; + mac->hw = eth; + mac->of_node = np; --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -453,6 +453,8 @@ @@ -142,3 +146,12 @@ Signed-off-by: Qingfang Deng /* Mac status registers */ #define MTK_MAC_MSR(x) (0x10108 + (x * 0x100)) #define MAC_MSR_EEE1G BIT(7) +@@ -1321,6 +1332,8 @@ struct mtk_mac { + int id; + phy_interface_t interface; + u8 ppe_idx; ++ bool tx_lpi_enabled; ++ u8 txidle_thd_ms; + int speed; + struct device_node *of_node; + struct phylink *phylink; diff --git a/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch b/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch index c25629e830..dbc139fb06 100644 --- a/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch +++ b/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch @@ -37,7 +37,7 @@ Signed-off-by: Bo-Cun Chen .glo_cfg = 0x4604, .rst_idx = 0x4608, .delay_irq = 0x460c, -@@ -3898,6 +3901,56 @@ static void mtk_set_mcr_max_rx(struct mt +@@ -3895,6 +3898,56 @@ static void mtk_set_mcr_max_rx(struct mt mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); } @@ -94,7 +94,7 @@ Signed-off-by: Bo-Cun Chen static void mtk_hw_reset(struct mtk_eth *eth) { u32 val; -@@ -4358,6 +4411,8 @@ static void mtk_pending_work(struct work +@@ -4354,6 +4407,8 @@ static void mtk_pending_work(struct work rtnl_lock(); set_bit(MTK_RESETTING, ð->state); diff --git a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index 021ed9fa73..a80433c986 100644 --- a/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.6/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5101,6 +5101,8 @@ static int mtk_probe(struct platform_dev +@@ -5105,6 +5105,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-6.6/730-net-ethernet-mtk_eth_soc-reset-all-TX-queues-on-DMA-.patch b/target/linux/generic/pending-6.6/730-net-ethernet-mtk_eth_soc-reset-all-TX-queues-on-DMA-.patch index 6995ad31c1..572c07eb70 100644 --- a/target/linux/generic/pending-6.6/730-net-ethernet-mtk_eth_soc-reset-all-TX-queues-on-DMA-.patch +++ b/target/linux/generic/pending-6.6/730-net-ethernet-mtk_eth_soc-reset-all-TX-queues-on-DMA-.patch @@ -23,7 +23,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3148,11 +3148,19 @@ static int mtk_dma_init(struct mtk_eth * +@@ -3145,11 +3145,19 @@ static int mtk_dma_init(struct mtk_eth * static void mtk_dma_free(struct mtk_eth *eth) { const struct mtk_soc_data *soc = eth->soc; diff --git a/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch index e6e97cffff..07ade816a6 100644 --- a/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch +++ b/target/linux/generic/pending-6.6/732-00-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -1347,6 +1347,22 @@ struct mtk_mac { +@@ -1349,6 +1349,22 @@ struct mtk_mac { /* the struct describing the SoC. these are declared in the soc_xyz.c files */ extern const struct of_device_id of_mtk_match[]; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau static inline bool mtk_is_netsys_v1(struct mtk_eth *eth) { return eth->soc->version == 1; -@@ -1361,6 +1377,7 @@ static inline bool mtk_is_netsys_v3_or_g +@@ -1363,6 +1379,7 @@ static inline bool mtk_is_netsys_v3_or_g { return eth->soc->version > 2; } diff --git a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch index 8e2c7d5a35..87e376c3c4 100644 --- a/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch +++ b/target/linux/generic/pending-6.6/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch @@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau #include #include "mtk_eth_soc.h" -@@ -1609,12 +1610,28 @@ static void mtk_wake_queue(struct mtk_et +@@ -1606,12 +1607,28 @@ static void mtk_wake_queue(struct mtk_et } } @@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau bool gso = false; int tx_num; -@@ -1636,6 +1653,18 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1633,6 +1650,18 @@ static netdev_tx_t mtk_start_xmit(struct return NETDEV_TX_BUSY; } @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau /* TSO: fill MSS info in tcp checksum field */ if (skb_is_gso(skb)) { if (skb_cow_head(skb, 0)) { -@@ -1651,8 +1680,14 @@ static netdev_tx_t mtk_start_xmit(struct +@@ -1648,8 +1677,14 @@ static netdev_tx_t mtk_start_xmit(struct } } diff --git a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch index 7f1a638af0..a2a10d1417 100644 --- a/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch +++ b/target/linux/generic/pending-6.6/733-01-net-ethernet-mtk_eth_soc-use-napi_build_skb.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2153,7 +2153,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2150,7 +2150,7 @@ static int mtk_poll_rx(struct napi_struc if (ret != XDP_PASS) goto skip_rx; @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau if (unlikely(!skb)) { page_pool_put_full_page(ring->page_pool, page, true); -@@ -2191,7 +2191,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -2188,7 +2188,7 @@ static int mtk_poll_rx(struct napi_struc dma_unmap_single(eth->dma_dev, ((u64)trxd.rxd1 | addr64), ring->buf_size, DMA_FROM_DEVICE); diff --git a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch b/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch index 3d2aee9485..ccb9d1bc1d 100644 --- a/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch +++ b/target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch @@ -25,7 +25,7 @@ Signed-off-by: Chad Monroe /* QDMA Flow Control Register */ --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3322,12 +3322,14 @@ static int mtk_start_dma(struct mtk_eth +@@ -3319,12 +3319,14 @@ static int mtk_start_dma(struct mtk_eth MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE; diff --git a/target/linux/generic/pending-6.6/735-net-ethernet-mtk_eth_soc-fix-memory-corruption-durin.patch b/target/linux/generic/pending-6.6/735-net-ethernet-mtk_eth_soc-fix-memory-corruption-durin.patch index 419c158c5c..6d7a6ed052 100644 --- a/target/linux/generic/pending-6.6/735-net-ethernet-mtk_eth_soc-fix-memory-corruption-durin.patch +++ b/target/linux/generic/pending-6.6/735-net-ethernet-mtk_eth_soc-fix-memory-corruption-durin.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1185,7 +1185,7 @@ static int mtk_init_fq_dma(struct mtk_et +@@ -1182,7 +1182,7 @@ static int mtk_init_fq_dma(struct mtk_et if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr))) return -ENOMEM; diff --git a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch index 09067c4712..067ea1f86d 100644 --- a/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch +++ b/target/linux/generic/pending-6.6/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch @@ -426,7 +426,7 @@ Signed-off-by: Daniel Golle u32 mcr; mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); -@@ -829,9 +916,63 @@ static void mtk_mac_link_up(struct phyli +@@ -826,9 +913,63 @@ static void mtk_mac_link_up(struct phyli mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); } @@ -490,7 +490,7 @@ Signed-off-by: Daniel Golle .mac_finish = mtk_mac_finish, .mac_link_down = mtk_mac_link_down, .mac_link_up = mtk_mac_link_up, -@@ -3430,6 +3571,9 @@ static int mtk_open(struct net_device *d +@@ -3427,6 +3568,9 @@ static int mtk_open(struct net_device *d ppe_num = eth->soc->ppe_num; @@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3580,6 +3724,9 @@ static int mtk_stop(struct net_device *d +@@ -3577,6 +3721,9 @@ static int mtk_stop(struct net_device *d for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) mtk_ppe_stop(eth->ppe[i]); @@ -510,7 +510,7 @@ Signed-off-by: Daniel Golle return 0; } -@@ -4645,6 +4792,7 @@ static const struct net_device_ops mtk_n +@@ -4647,6 +4794,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { const __be32 *_id = of_get_property(np, "reg", NULL); @@ -518,7 +518,7 @@ Signed-off-by: Daniel Golle phy_interface_t phy_mode; struct phylink *phylink; struct mtk_mac *mac; -@@ -4681,16 +4829,41 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4685,16 +4833,41 @@ static int mtk_add_mac(struct mtk_eth *e mac->id = id; mac->hw = eth; mac->of_node = np; @@ -568,7 +568,7 @@ Signed-off-by: Daniel Golle } memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip)); -@@ -4773,8 +4946,21 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4777,8 +4950,21 @@ static int mtk_add_mac(struct mtk_eth *e phy_interface_zero(mac->phylink_config.supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, mac->phylink_config.supported_interfaces); @@ -590,7 +590,7 @@ Signed-off-by: Daniel Golle phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4825,6 +5011,26 @@ free_netdev: +@@ -4829,6 +5015,26 @@ free_netdev: return err; } @@ -617,7 +617,7 @@ Signed-off-by: Daniel Golle void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev) { struct net_device *dev, *tmp; -@@ -4971,7 +5177,8 @@ static int mtk_probe(struct platform_dev +@@ -4975,7 +5181,8 @@ static int mtk_probe(struct platform_dev regmap_write(cci, 0, 3); } @@ -627,7 +627,7 @@ Signed-off-by: Daniel Golle err = mtk_sgmii_init(eth); if (err) -@@ -5082,6 +5289,24 @@ static int mtk_probe(struct platform_dev +@@ -5086,6 +5293,24 @@ static int mtk_probe(struct platform_dev } } @@ -652,7 +652,7 @@ Signed-off-by: Daniel Golle if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) { err = devm_request_irq(eth->dev, eth->irq[0], mtk_handle_irq, 0, -@@ -5185,6 +5410,11 @@ static int mtk_remove(struct platform_de +@@ -5189,6 +5414,11 @@ static int mtk_remove(struct platform_de mtk_stop(eth->netdev[i]); mac = netdev_priv(eth->netdev[i]); phylink_disconnect_phy(mac->phylink); @@ -893,7 +893,7 @@ Signed-off-by: Daniel Golle struct mtk_tx_dma_desc_info { dma_addr_t addr; -@@ -1336,6 +1393,9 @@ struct mtk_mac { +@@ -1338,6 +1395,9 @@ struct mtk_mac { struct device_node *of_node; struct phylink *phylink; struct phylink_config phylink_config; @@ -903,7 +903,7 @@ Signed-off-by: Daniel Golle struct mtk_eth *hw; struct mtk_hw_stats *hw_stats; __be32 hwlro_ip[MTK_MAX_LRO_IP_CNT]; -@@ -1459,6 +1519,19 @@ static inline u32 mtk_get_ib2_multicast_ +@@ -1461,6 +1521,19 @@ static inline u32 mtk_get_ib2_multicast_ return MTK_FOE_IB2_MULTICAST; } @@ -923,7 +923,7 @@ Signed-off-by: Daniel Golle /* read the hardware status register */ void mtk_stats_update_mac(struct mtk_mac *mac); -@@ -1467,8 +1540,10 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne +@@ -1469,8 +1542,10 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned int reg); int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id); diff --git a/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch b/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch index 03e610e8c2..30f645c728 100644 --- a/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch +++ b/target/linux/generic/pending-6.6/738-01-net-ethernet-mtk_eth_soc-reduce-rx-ring-size-for-older.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5446,7 +5446,7 @@ static const struct mtk_soc_data mt2701_ +@@ -5450,7 +5450,7 @@ static const struct mtk_soc_data mt2701_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5474,7 +5474,7 @@ static const struct mtk_soc_data mt7621_ +@@ -5478,7 +5478,7 @@ static const struct mtk_soc_data mt7621_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5504,7 +5504,7 @@ static const struct mtk_soc_data mt7622_ +@@ -5508,7 +5508,7 @@ static const struct mtk_soc_data mt7622_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5533,7 +5533,7 @@ static const struct mtk_soc_data mt7623_ +@@ -5537,7 +5537,7 @@ static const struct mtk_soc_data mt7623_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5559,7 +5559,7 @@ static const struct mtk_soc_data mt7629_ +@@ -5563,7 +5563,7 @@ static const struct mtk_soc_data mt7629_ .desc_size = sizeof(struct mtk_rx_dma), .irq_done_mask = MTK_RX_DONE_INT, .dma_l4_valid = RX_DMA_L4_VALID, @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, }, -@@ -5591,7 +5591,7 @@ static const struct mtk_soc_data mt7981_ +@@ -5595,7 +5595,7 @@ static const struct mtk_soc_data mt7981_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau }, }; -@@ -5621,7 +5621,7 @@ static const struct mtk_soc_data mt7986_ +@@ -5625,7 +5625,7 @@ static const struct mtk_soc_data mt7986_ .dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau }, }; -@@ -5674,7 +5674,7 @@ static const struct mtk_soc_data rt5350_ +@@ -5678,7 +5678,7 @@ static const struct mtk_soc_data rt5350_ .dma_l4_valid = RX_DMA_L4_VALID_PDMA, .dma_max_len = MTK_TX_DMA_BUF_LEN, .dma_len_offset = 16, diff --git a/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch b/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch index c74c9e888f..628e61f77d 100644 --- a/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch +++ b/target/linux/generic/pending-6.6/738-02-net-ethernet-mtk_eth_soc-do-not-enable-page-pool-sta.patch @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau help --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4566,6 +4566,7 @@ static int mtk_get_sset_count(struct net +@@ -4562,6 +4562,7 @@ static int mtk_get_sset_count(struct net static void mtk_ethtool_pp_stats(struct mtk_eth *eth, u64 *data) { @@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau struct page_pool_stats stats = {}; int i; -@@ -4578,6 +4579,7 @@ static void mtk_ethtool_pp_stats(struct +@@ -4574,6 +4575,7 @@ static void mtk_ethtool_pp_stats(struct page_pool_get_stats(ring->page_pool, &stats); } page_pool_ethtool_stats_get(data, &stats); From 7728f6660622ee9478e2a1932877d59fd1c4cae3 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 22 Feb 2025 14:15:12 +0800 Subject: [PATCH 15/21] ath10k-ct-firmware: remove QCA9888 board file symbolic link Although ath10k pre-calibration data and board description file have similar data structures, they are completely different things. Therefore, let's remove these incorrect and confusing links. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18069 Signed-off-by: Robert Marko --- package/firmware/ath10k-ct-firmware/Makefile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/package/firmware/ath10k-ct-firmware/Makefile b/package/firmware/ath10k-ct-firmware/Makefile index f861a32b8b..960fc93e15 100644 --- a/package/firmware/ath10k-ct-firmware/Makefile +++ b/package/firmware/ath10k-ct-firmware/Makefile @@ -593,27 +593,18 @@ endef define Package/ath10k-firmware-qca9888-ct/install $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0 - ln -s \ - ../../cal-pci-0000:01:00.0.bin \ - $(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin $(INSTALL_DATA) \ $(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9888) \ $(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin endef define Package/ath10k-firmware-qca9888-ct-full-htt/install $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0 - ln -s \ - ../../cal-pci-0000:01:00.0.bin \ - $(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin $(INSTALL_DATA) \ $(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9888) \ $(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin endef define Package/ath10k-firmware-qca9888-ct-htt/install $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0 - ln -s \ - ../../cal-pci-0000:01:00.0.bin \ - $(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin $(INSTALL_DATA) \ $(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9888) \ $(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin From 2e71e41ce66077515a8c4f5be82c75aeeead659d Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 30 Mar 2025 08:40:06 -0400 Subject: [PATCH 16/21] kernel: bump 6.6 to 6.6.85 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.85 Removed upstreamed: bcm27xx/patches-6.6/950-1498-dts-bcm2711-PL011-UARTs-are-actually-r1p5.patch[1] bcm27xx/patches-6.6/950-1551-drm-v3d-Don-t-run-jobs-that-have-errors-flagged-in-i.patch[2] Manually rebased: bcm27xx/patches-6.6/950-1512-dts-bcm2711-Don-t-mark-timer-regs-unconfigured.patch All other patches automatically rebased. 1. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.85&id=61820187b3ef5a15aed7ef49ed1fcc13398b449c 2. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.85&id=7cd375d46afcce906cfcddf5aec6b318199d1f16 Build system: x86/64 Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/18379 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- ...gfs-end-points-to-query-GPU-usage-st.patch | 10 +-- ...ix-up-register-addresses-for-V3D-7.x.patch | 12 ++-- ...cm2711-PL011-UARTs-are-actually-r1p5.patch | 60 ------------------ ...1-Don-t-mark-timer-regs-unconfigured.patch | 11 ---- ...n-jobs-that-have-errors-flagged-in-i.patch | 61 ------------------- ...ng-with-source-address-failed-policy.patch | 18 +++--- 7 files changed, 22 insertions(+), 154 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-6.6/950-1498-dts-bcm2711-PL011-UARTs-are-actually-r1p5.patch delete mode 100644 target/linux/bcm27xx/patches-6.6/950-1551-drm-v3d-Don-t-run-jobs-that-have-errors-flagged-in-i.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 250365a50f..2b70664440 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .84 -LINUX_KERNEL_HASH-6.6.84 = 7fd20721551a61db347c5ac6ca05818e24058682be4e4389dc51e88d4ac17ba7 +LINUX_VERSION-6.6 = .85 +LINUX_KERNEL_HASH-6.6.85 = 5ebaccf4ca3428cd26817bae62171f4efd270eed866a3e3d0a1d9e970b7b7529 diff --git a/target/linux/bcm27xx/patches-6.6/950-0464-drm-v3d-New-debugfs-end-points-to-query-GPU-usage-st.patch b/target/linux/bcm27xx/patches-6.6/950-0464-drm-v3d-New-debugfs-end-points-to-query-GPU-usage-st.patch index 6e546e6754..9ff7a6d0ad 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0464-drm-v3d-New-debugfs-end-points-to-query-GPU-usage-st.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0464-drm-v3d-New-debugfs-end-points-to-query-GPU-usage-st.patch @@ -423,7 +423,7 @@ Signed-off-by: Jose Maria Casanova Crespo v3d_switch_perfmon(v3d, &job->base); /* XXX: Set the QCFG */ -@@ -190,6 +301,7 @@ v3d_tfu_job_run(struct drm_sched_job *sc +@@ -194,6 +305,7 @@ v3d_tfu_job_run(struct drm_sched_job *sc trace_v3d_submit_tfu(dev, to_v3d_fence(fence)->seqno); @@ -431,7 +431,7 @@ Signed-off-by: Jose Maria Casanova Crespo V3D_WRITE(V3D_TFU_IIA, job->args.iia); V3D_WRITE(V3D_TFU_IIS, job->args.iis); V3D_WRITE(V3D_TFU_ICA, job->args.ica); -@@ -231,6 +343,7 @@ v3d_csd_job_run(struct drm_sched_job *sc +@@ -238,6 +350,7 @@ v3d_csd_job_run(struct drm_sched_job *sc trace_v3d_submit_csd(dev, to_v3d_fence(fence)->seqno); @@ -439,7 +439,7 @@ Signed-off-by: Jose Maria Casanova Crespo v3d_switch_perfmon(v3d, &job->base); for (i = 1; i <= 6; i++) -@@ -247,7 +360,10 @@ v3d_cache_clean_job_run(struct drm_sched +@@ -254,7 +367,10 @@ v3d_cache_clean_job_run(struct drm_sched struct v3d_job *job = to_v3d_job(sched_job); struct v3d_dev *v3d = job->v3d; @@ -450,7 +450,7 @@ Signed-off-by: Jose Maria Casanova Crespo return NULL; } -@@ -385,8 +501,18 @@ v3d_sched_init(struct v3d_dev *v3d) +@@ -392,8 +508,18 @@ v3d_sched_init(struct v3d_dev *v3d) int hw_jobs_limit = 1; int job_hang_limit = 0; int hang_limit_ms = 500; @@ -469,7 +469,7 @@ Signed-off-by: Jose Maria Casanova Crespo ret = drm_sched_init(&v3d->queue[V3D_BIN].sched, &v3d_bin_sched_ops, hw_jobs_limit, job_hang_limit, -@@ -440,9 +566,20 @@ void +@@ -447,9 +573,20 @@ void v3d_sched_fini(struct v3d_dev *v3d) { enum v3d_queue q; diff --git a/target/linux/bcm27xx/patches-6.6/950-0555-drm-v3d-fix-up-register-addresses-for-V3D-7.x.patch b/target/linux/bcm27xx/patches-6.6/950-0555-drm-v3d-fix-up-register-addresses-for-V3D-7.x.patch index ca8a34e8e1..4e81342876 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0555-drm-v3d-fix-up-register-addresses-for-V3D-7.x.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0555-drm-v3d-fix-up-register-addresses-for-V3D-7.x.patch @@ -600,7 +600,7 @@ v2: fix kernel panic with debug-fs interface to list registers static struct dma_fence * v3d_tfu_job_run(struct drm_sched_job *sched_job) { -@@ -302,20 +304,22 @@ v3d_tfu_job_run(struct drm_sched_job *sc +@@ -306,20 +308,22 @@ v3d_tfu_job_run(struct drm_sched_job *sc trace_v3d_submit_tfu(dev, to_v3d_fence(fence)->seqno); v3d_sched_stats_add_job(&v3d->gpu_queue_stats[V3D_TFU], sched_job); @@ -635,16 +635,16 @@ v2: fix kernel panic with debug-fs interface to list registers return fence; } -@@ -327,7 +331,7 @@ v3d_csd_job_run(struct drm_sched_job *sc +@@ -331,7 +335,7 @@ v3d_csd_job_run(struct drm_sched_job *sc struct v3d_dev *v3d = job->base.v3d; struct drm_device *dev = &v3d->drm; struct dma_fence *fence; - int i; + int i, csd_cfg0_reg, csd_cfg_reg_count; - v3d->csd_job = job; - -@@ -346,10 +350,12 @@ v3d_csd_job_run(struct drm_sched_job *sc + if (unlikely(job->base.base.s_fence->finished.error)) + return NULL; +@@ -353,10 +357,12 @@ v3d_csd_job_run(struct drm_sched_job *sc v3d_sched_stats_add_job(&v3d->gpu_queue_stats[V3D_CSD], sched_job); v3d_switch_perfmon(v3d, &job->base); @@ -660,7 +660,7 @@ v2: fix kernel panic with debug-fs interface to list registers return fence; } -@@ -452,7 +458,8 @@ v3d_csd_job_timedout(struct drm_sched_jo +@@ -459,7 +465,8 @@ v3d_csd_job_timedout(struct drm_sched_jo { struct v3d_csd_job *job = to_csd_job(sched_job); struct v3d_dev *v3d = job->base.v3d; diff --git a/target/linux/bcm27xx/patches-6.6/950-1498-dts-bcm2711-PL011-UARTs-are-actually-r1p5.patch b/target/linux/bcm27xx/patches-6.6/950-1498-dts-bcm2711-PL011-UARTs-are-actually-r1p5.patch deleted file mode 100644 index a184b3134a..0000000000 --- a/target/linux/bcm27xx/patches-6.6/950-1498-dts-bcm2711-PL011-UARTs-are-actually-r1p5.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 87fc066350358ce45f5ad52424c8a2e351b1720c Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 7 Jan 2025 12:05:41 +0000 -Subject: [PATCH] dts: bcm2711: PL011 UARTs are actually r1p5 - -The ARM PL011 UART instances in BCM2711 are r1p5 spec, which means they -have 32-entry FIFOs. The correct periphid value for this is 0x00341011. -Thanks to N Buchwitz for pointing this out. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/broadcom/bcm2711.dtsi | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - ---- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi -+++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi -@@ -134,7 +134,7 @@ - clocks = <&clocks BCM2835_CLOCK_UART>, - <&clocks BCM2835_CLOCK_VPU>; - clock-names = "uartclk", "apb_pclk"; -- arm,primecell-periphid = <0x00241011>; -+ arm,primecell-periphid = <0x00341011>; - status = "disabled"; - }; - -@@ -145,7 +145,7 @@ - clocks = <&clocks BCM2835_CLOCK_UART>, - <&clocks BCM2835_CLOCK_VPU>; - clock-names = "uartclk", "apb_pclk"; -- arm,primecell-periphid = <0x00241011>; -+ arm,primecell-periphid = <0x00341011>; - status = "disabled"; - }; - -@@ -156,7 +156,7 @@ - clocks = <&clocks BCM2835_CLOCK_UART>, - <&clocks BCM2835_CLOCK_VPU>; - clock-names = "uartclk", "apb_pclk"; -- arm,primecell-periphid = <0x00241011>; -+ arm,primecell-periphid = <0x00341011>; - status = "disabled"; - }; - -@@ -167,7 +167,7 @@ - clocks = <&clocks BCM2835_CLOCK_UART>, - <&clocks BCM2835_CLOCK_VPU>; - clock-names = "uartclk", "apb_pclk"; -- arm,primecell-periphid = <0x00241011>; -+ arm,primecell-periphid = <0x00341011>; - status = "disabled"; - }; - -@@ -1155,6 +1155,7 @@ - }; - - &uart0 { -+ arm,primecell-periphid = <0x00341011>; - interrupts = ; - }; - diff --git a/target/linux/bcm27xx/patches-6.6/950-1512-dts-bcm2711-Don-t-mark-timer-regs-unconfigured.patch b/target/linux/bcm27xx/patches-6.6/950-1512-dts-bcm2711-Don-t-mark-timer-regs-unconfigured.patch index 81b37af340..168dd19f16 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1512-dts-bcm2711-Don-t-mark-timer-regs-unconfigured.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1512-dts-bcm2711-Don-t-mark-timer-regs-unconfigured.patch @@ -20,17 +20,6 @@ Signed-off-by: Phil Elwell arch/arm64/boot/dts/broadcom/bcm2712.dtsi | 2 -- 2 files changed, 4 deletions(-) ---- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi -+++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi -@@ -451,8 +451,6 @@ - IRQ_TYPE_LEVEL_LOW)>, - ; -- /* This only applies to the ARMv7 stub */ -- arm,cpu-registers-not-fw-configured; - }; - - cpus: cpus { --- a/arch/arm64/boot/dts/broadcom/bcm2712.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcm2712.dtsi @@ -741,8 +741,6 @@ diff --git a/target/linux/bcm27xx/patches-6.6/950-1551-drm-v3d-Don-t-run-jobs-that-have-errors-flagged-in-i.patch b/target/linux/bcm27xx/patches-6.6/950-1551-drm-v3d-Don-t-run-jobs-that-have-errors-flagged-in-i.patch deleted file mode 100644 index cdb9ad1888..0000000000 --- a/target/linux/bcm27xx/patches-6.6/950-1551-drm-v3d-Don-t-run-jobs-that-have-errors-flagged-in-i.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 5258ca4ad089548a72657522443b9c3e46fd125b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ma=C3=ADra=20Canal?= -Date: Sat, 22 Feb 2025 14:40:21 -0300 -Subject: [PATCH] drm/v3d: Don't run jobs that have errors flagged in its fence -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The V3D driver still relies on `drm_sched_increase_karma()` and -`drm_sched_resubmit_jobs()` for resubmissions when a timeout occurs. -The function `drm_sched_increase_karma()` marks the job as guilty, while -`drm_sched_resubmit_jobs()` sets an error (-ECANCELED) in the DMA fence of -that guilty job. - -Because of this, we must check whether the job’s DMA fence has been -flagged with an error before executing the job. Otherwise, the same guilty -job may be resubmitted indefinitely, causing repeated GPU resets. - -This patch adds a check for an error on the job's fence to prevent running -a guilty job that was previously flagged when the GPU timed out. - -Note that the CPU and CACHE_CLEAN queues do not require this check, as -their jobs are executed synchronously once the DRM scheduler starts them. - -Cc: stable@vger.kernel.org -Fixes: d223f98f0209 ("drm/v3d: Add support for compute shader dispatch.") -Fixes: 1584f16ca96e ("drm/v3d: Add support for submitting jobs to the TFU.") -Signed-off-by: Maíra Canal ---- - drivers/gpu/drm/v3d/v3d_sched.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/v3d/v3d_sched.c -+++ b/drivers/gpu/drm/v3d/v3d_sched.c -@@ -292,11 +292,15 @@ v3d_tfu_job_run(struct drm_sched_job *sc - struct drm_device *dev = &v3d->drm; - struct dma_fence *fence; - -+ if (unlikely(job->base.base.s_fence->finished.error)) -+ return NULL; -+ -+ v3d->tfu_job = job; -+ - fence = v3d_fence_create(v3d, V3D_TFU); - if (IS_ERR(fence)) - return NULL; - -- v3d->tfu_job = job; - if (job->base.irq_fence) - dma_fence_put(job->base.irq_fence); - job->base.irq_fence = dma_fence_get(fence); -@@ -333,6 +337,9 @@ v3d_csd_job_run(struct drm_sched_job *sc - struct dma_fence *fence; - int i, csd_cfg0_reg, csd_cfg_reg_count; - -+ if (unlikely(job->base.base.s_fence->finished.error)) -+ return NULL; -+ - v3d->csd_job = job; - - v3d_invalidate_caches(v3d); diff --git a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 9b76c82a6f..ccafdf2911 100644 --- a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4551,6 +4570,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4554,6 +4573,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5042,7 +5072,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5045,7 +5075,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6304,6 +6335,8 @@ static int ip6_route_dev_notify(struct n +@@ -6307,6 +6338,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6315,6 +6348,7 @@ static int ip6_route_dev_notify(struct n +@@ -6318,6 +6351,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6515,6 +6549,8 @@ static int __net_init ip6_route_net_init +@@ -6518,6 +6552,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6525,11 +6561,21 @@ static int __net_init ip6_route_net_init +@@ -6528,11 +6564,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6556,6 +6602,8 @@ out: +@@ -6559,6 +6605,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6575,6 +6623,7 @@ static void __net_exit ip6_route_net_exi +@@ -6578,6 +6626,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6658,6 +6707,9 @@ void __init ip6_route_init_special_entri +@@ -6661,6 +6710,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001 From: Ivan Davydov Date: Tue, 4 Mar 2025 23:54:13 +0300 Subject: [PATCH 17/21] ramips: mt76x8: add support for Keenetic Launcher (KN-1221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specification: SoC: MediaTek MT7628AN RAM: 128M DDR2, ESMT M14D128168A (2Y) Flash: 32M, cFeon EN25QH256A (Dual Boot on OEM, concatenated on OpenWrt, SPI) Switch: MediaTek MT7628AN, 3 ports 100 Mbps WiFi: MediaTek MT7628AN 2.4 GHz 802.11n USB: 1 port USB 2.0 GPIO: 1 button (Wi-Fi & Reset on OEM, Reset on OpenWrt), 3 LEDs (Power, Internet, Wi-Fi), USB port power controls Disassembly: There are 2 screws at the bottom near the LEDs hidden by rubber mounts. After removing the screws, pry the gray plastic part around (it is secured with latches) and remove it. UART Interface: The UART interface can be connected to the 5 pin located between LAN ports and the WAN one. Pins (from the second LAN port to the WAN one): VCC, TX, RX, NC, GND Settings: 115200, 8N1 Flashing via TFTP: 1. Connect your PC and router to the first LAN port, configure PC interface using IP 192.168.1.2, mask 255.255.255.0 2. Serve the firmware image (for OpenWrt it is *-squashfs-factory.bin) renamed to KN-1221_recovery.bin via TFTP 3. Power up the router while pressing Wi-Fi button 4. Release Wi-Fi button when Power LED starts blinking To revert back to OEM firmware: The return to the OEM firmware is carried out by using the methods described above with the help of the appropriate firmware image found on osvault.keenetic.net. When using OEM bootloader, the firmware image size cannot exceed the size of one OEM «Firmware_x» partition or Kernel + rootFS size. Signed-off-by: Ivan Davydov Link: https://github.com/openwrt/openwrt/pull/18164 Signed-off-by: Hauke Mehrtens --- .../ramips/dts/mt7628an_keenetic_kn-1221.dts | 209 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 12 + .../mt76x8/base-files/etc/board.d/01_leds | 1 + .../mt76x8/base-files/etc/board.d/02_network | 5 + 4 files changed, 227 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts new file mode 100644 index 0000000000..6f5cf96856 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "keenetic,kn-1221", "mediatek,mt7628an-soc"; + model = "Keenetic KN-1221"; + + aliases { + label-mac-device = ðernet; + + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + regulator-usb { + compatible = "regulator-fixed"; + regulator-name = "USB-power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + internet { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + }; + + fn { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "restart"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0 0x1cc0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "spi cs1", "gpio", "refclk", "wdt"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <32000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "rf-eeprom"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + }; + + firmware1: partition@50000 { + label = "firmware_1"; + reg = <0x50000 0xe60000>; + }; + + partition@eb0000 { + label = "config_1"; + reg = <0xeb0000 0x40000>; + read-only; + }; + + partition@ef0000 { + label = "storage"; + reg = <0xef0000 0x100000>; + read-only; + }; + + partition@ff0000 { + label = "dump"; + reg = <0xff0000 0x10000>; + read-only; + }; + + partition@1000000 { + label = "u-state"; + reg = <0x1000000 0x30000>; + read-only; + }; + + partition@1030000 { + label = "u-config_res"; + reg = <0x1030000 0x10000>; + read-only; + }; + + partition@1040000 { + label = "rf-eeprom_res"; + reg = <0x1040000 0x10000>; + read-only; + }; + + firmware2: partition@1050000 { + label = "firmware_2"; + reg = <0x1050000 0xe60000>; + }; + + partition@1eb0000 { + label = "Config_2"; + reg = <0x1eb0000 0x40000>; + read-only; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x38>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 8c8cfee23b..f442148d9e 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -366,6 +366,18 @@ define Device/jotale_js76x8-32m endef TARGET_DEVICES += jotale_js76x8-32m +define Device/keenetic_kn-1221 + BLOCKSIZE := 64k + IMAGE_SIZE := 29440k + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-1221 + DEVICE_PACKAGES := kmod-usb2 + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ + check-size 14720k | zyimage -d 0x801221 -v "KN-1221" +endef +TARGET_DEVICES += keenetic_kn-1221 + define Device/keenetic_kn-1613 IMAGE_SIZE := 15073280 DEVICE_VENDOR := Keenetic diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index b87062ae3c..79f78a2a45 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -58,6 +58,7 @@ hiwifi,hc5661a|\ hiwifi,hc5761a) ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" ;; +keenetic,kn-1221|\ keenetic,kn-1613|\ keenetic,kn-1711|\ keenetic,kn-1713) diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index fbdc7fb5a2..6e6e1310d3 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -131,6 +131,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "6@eth0" ;; + keenetic,kn-1221) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "0:wan" "6@eth0" + ;; keenetic,kn-1613|\ keenetic,kn-1713|\ motorola,mwr03) @@ -287,6 +291,7 @@ ramips_setup_macs() totolink,lr1200) wan_mac=$(mtd_get_mac_binary factory 0x2e) ;; + keenetic,kn-1221|\ keenetic,kn-1613|\ keenetic,kn-3211|\ zyxel,keenetic-extra-ii) From 65b6f1c1b2512d5b91f3dd9b02bae0c17249d6fc Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Sun, 9 Mar 2025 22:17:12 -0500 Subject: [PATCH 18/21] ath79: move TP-Link RE450 v1 & v2 and RE355 v1 to tiny target This restores sysupgrade support Since OpenWrt 23.05, the firmware selector no longer provides sysupgrade images for RE450 V1 & V2 and RE355 v1 due to image size constraints (~5.7MB limit), making the generic build unusable. This commit moves RE450 V1 & V2 to the tiny target, enabling: - Smaller image builds within the flash size limit. - Restored sysupgrade support via the firmware selector. - A secure-by-default wireless setup while allowing full management via UCI. - Officially supported images, reducing the need for custom (potentially insecure) builds. This ensures users can install a functional OpenWrt build without compromising security defaults. Signed-off-by: Ivan Diaz [Squashed the commits together and just copied the target definition from the generic subtarget.] Link: https://github.com/openwrt/openwrt/pull/18126 Signed-off-by: Hauke Mehrtens --- .../generic/base-files/etc/board.d/01_leds | 3 -- .../generic/base-files/etc/board.d/02_network | 3 -- target/linux/ath79/image/generic-tp-link.mk | 39 ------------------- target/linux/ath79/image/tiny-tp-link.mk | 39 +++++++++++++++++++ .../ath79/tiny/base-files/etc/board.d/01_leds | 6 +++ .../tiny/base-files/etc/board.d/02_network | 3 ++ 6 files changed, 48 insertions(+), 45 deletions(-) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 4eddde1115..4107563439 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -464,9 +464,6 @@ tplink,tl-wr902ac-v1) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ucidef_set_led_netdev "internet" "Internet" "green:internet" "eth0" ;; -tplink,re355-v1|\ -tplink,re450-v1|\ -tplink,re450-v2|\ tplink,re450-v3|\ tplink,re455-v1) ucidef_set_led_netdev "lan_data" "LAN Data" "green:lan_data" "eth0" "tx rx" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index b1e5818567..4da8d36d50 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -98,9 +98,6 @@ ath79_setup_interfaces() tplink,eap225-v4|\ tplink,eap245-v1|\ tplink,re350k-v1|\ - tplink,re355-v1|\ - tplink,re450-v1|\ - tplink,re450-v2|\ tplink,re450-v3|\ tplink,re455-v1|\ tplink,tl-wa1201-v2|\ diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index c42338db78..e9a63ad12b 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -537,45 +537,6 @@ define Device/tplink_re350k-v1 endef TARGET_DEVICES += tplink_re350k-v1 -define Device/tplink_rex5x-v1 - $(Device/tplink-safeloader) - SOC := qca9558 - IMAGE_SIZE := 6016k - DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct - DEFAULT := n -endef - -define Device/tplink_re355-v1 - $(Device/tplink_rex5x-v1) - DEVICE_MODEL := RE355 - DEVICE_VARIANT := v1 - TPLINK_BOARD_ID := RE355 - SUPPORTED_DEVICES += re355 -endef -TARGET_DEVICES += tplink_re355-v1 - -define Device/tplink_re450-v1 - $(Device/tplink_rex5x-v1) - DEVICE_MODEL := RE450 - DEVICE_VARIANT := v1 - TPLINK_BOARD_ID := RE450 - SUPPORTED_DEVICES += re450 -endef -TARGET_DEVICES += tplink_re450-v1 - -define Device/tplink_re450-v2 - $(Device/tplink-safeloader) - SOC := qca9563 - IMAGE_SIZE := 6016k - DEVICE_MODEL := RE450 - DEVICE_VARIANT := v2 - DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct - TPLINK_BOARD_ID := RE450-V2 - LOADER_TYPE := elf - DEFAULT := n -endef -TARGET_DEVICES += tplink_re450-v2 - define Device/tplink_re450-v3 $(Device/tplink-safeloader) SOC := qca9563 diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 70c3ab4c7b..9e5b74db8c 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -1,5 +1,44 @@ include ./common-tp-link.mk +define Device/tplink_rex5x-v1 + $(Device/tplink-safeloader) + SOC := qca9558 + IMAGE_SIZE := 6016k + DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct + DEFAULT := n +endef + +define Device/tplink_re355-v1 + $(Device/tplink_rex5x-v1) + DEVICE_MODEL := RE355 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := RE355 + SUPPORTED_DEVICES += re355 +endef +TARGET_DEVICES += tplink_re355-v1 + +define Device/tplink_re450-v1 + $(Device/tplink_rex5x-v1) + DEVICE_MODEL := RE450 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := RE450 + SUPPORTED_DEVICES += re450 +endef +TARGET_DEVICES += tplink_re450-v1 + +define Device/tplink_re450-v2 + $(Device/tplink-safeloader) + SOC := qca9563 + IMAGE_SIZE := 6016k + DEVICE_MODEL := RE450 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct + TPLINK_BOARD_ID := RE450-V2 + LOADER_TYPE := elf + DEFAULT := n +endef +TARGET_DEVICES += tplink_re450-v2 + define Device/tplink_tl-mr10u $(Device/tplink-4mlzma) SOC := ar9331 diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/01_leds b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds index 76d14ebb71..a09cfaee81 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds @@ -59,6 +59,12 @@ on,n150r) ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02" "0x0f" ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04" "0x0f" ;; +tplink,re355-v1|\ +tplink,re450-v1|\ +tplink,re450-v2) + ucidef_set_led_netdev "lan_data" "LAN Data" "green:lan_data" "eth0" "tx rx" + ucidef_set_led_netdev "lan_link" "LAN Link" "green:lan_link" "eth0" "link" + ;; tplink,tl-mr3020-v1|\ tplink,tl-mr3040-v2|\ tplink,tl-wa701nd-v1|\ diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index a204e820ca..8bc7040d03 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -16,6 +16,9 @@ ath79_setup_interfaces() engenius,eap350-v1|\ engenius,ecb350-v1|\ pqi,air-pen|\ + tplink,re355-v1|\ + tplink,re450-v1|\ + tplink,re450-v2|\ tplink,tl-mr10u|\ tplink,tl-mr3020-v1|\ tplink,tl-mr3040-v2|\ From f7638eb00a78c16b3c17bed66183fb9cf138d97c Mon Sep 17 00:00:00 2001 From: jonathan brophy Date: Thu, 26 Dec 2024 23:01:33 +1300 Subject: [PATCH 19/21] stm32: add default kernel config option CONFIG_LEDS_CLASS_MULTICOLOR The generic target configuration activates the CONFIG_LEDS_CLASS_MULTICOLOR option. Do not deactivate it for the stm32 target. Signed-off-by: jonathan brophy Link: https://github.com/openwrt/openwrt/pull/17277 [Reword commit message] Signed-off-by: Hauke Mehrtens --- target/linux/stm32/stm32mp1/config-6.6 | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/stm32/stm32mp1/config-6.6 b/target/linux/stm32/stm32mp1/config-6.6 index f7ed9030c6..31ead21ce7 100644 --- a/target/linux/stm32/stm32mp1/config-6.6 +++ b/target/linux/stm32/stm32mp1/config-6.6 @@ -274,7 +274,6 @@ CONFIG_KERNEL_GZIP=y CONFIG_KMAP_LOCAL=y CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y # CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set -# CONFIG_LEDS_CLASS_MULTICOLOR is not set CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_TRIGGER_ONESHOT=y From f169c57242076795579ba1741045adb8eb96baa5 Mon Sep 17 00:00:00 2001 From: jonathan brophy Date: Sun, 15 Dec 2024 13:36:29 +1300 Subject: [PATCH 20/21] kernel: modules: reenable led-group-multi-color patch This reverts commit 1375a7bae0d5e8dddb6b6cfe0584a399cd6c20b4. This version does not activate the CONFIG_LEDS_CLASS_MULTICOLOR option, this option is controlled by the generic target configuration. Signed-off-by: jonathan brophy Link: https://github.com/openwrt/openwrt/pull/17277 [Reword commit message] Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/leds.mk | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index 98e6fc8849..adda41db30 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -24,6 +24,23 @@ $(eval $(call KernelPackage,leds-gpio)) LED_TRIGGER_DIR=$(LINUX_DIR)/drivers/leds/trigger +define KernelPackage/led-group-multi-color + SUBMENU:=$(LEDS_MENU) + TITLE:=LEDs group multi-color support + KCONFIG:=CONFIG_LEDS_GROUP_MULTICOLOR + FILES:=$(LINUX_DIR)/drivers/leds/rgb/leds-group-multicolor.ko + AUTOLOAD:=$(call AutoProbe,led-group-multi-color) +endef + +define KernelPackage/led-group-multi-color/description + This option enables support for monochrome LEDs that are grouped + into multicolor LEDs which is useful in the case where LEDs of + different colors are physically grouped in a single multi-color LED + and driven by a controller that does not have multi-color support. +endef + +$(eval $(call KernelPackage,led-group-multi-color)) + define KernelPackage/ledtrig-activity SUBMENU:=$(LEDS_MENU) TITLE:=LED Activity Trigger @@ -330,4 +347,4 @@ define KernelPackage/leds-lp5562/description LED controllers. endef -$(eval $(call KernelPackage,leds-lp5562)) \ No newline at end of file +$(eval $(call KernelPackage,leds-lp5562)) From fa50e53aa92e4db9dfe091e7dd55c3fc2024ad13 Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Mon, 27 Jan 2025 14:44:27 -0800 Subject: [PATCH 21/21] mac80211: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues Backport two commits to resolve issues with ath1kk causing it to fail driver registration on iommuless systems with DRAM outside of 32bit addressing such as a 4GiB imx8mm: commit 1bcd20981834 ("wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues") commit eeadc6baf8b3 ("wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation") Signed-off-by: Tim Harvey Link: https://github.com/openwrt/openwrt/pull/17751 Signed-off-by: Robert Marko --- ...allocation-to-resolve-SWIOTLB-issues.patch | 91 +++++++ ...oherent-for-rx-tid-buffer-allocation.patch | 255 ++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch create mode 100644 package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch diff --git a/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch b/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch new file mode 100644 index 0000000000..d5d80a395d --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch @@ -0,0 +1,91 @@ +wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues +Currently, the driver allocates cacheable DMA buffers for rings like +HAL_REO_DST and HAL_WBM2SW_RELEASE. The buffers for HAL_WBM2SW_RELEASE +are large (1024 KiB), exceeding the SWIOTLB slot size of 256 KiB. This +leads to "swiotlb buffer is full" error messages on systems without an +IOMMU that use SWIOTLB, causing driver initialization failures. The driver +calls dma_map_single() with these large buffers obtained from kzalloc(), +resulting in ring initialization errors on systems without an IOMMU that +use SWIOTLB. + +To address these issues, replace the flawed buffer allocation mechanism +with the appropriate DMA API. Specifically, use dma_alloc_noncoherent() +for cacheable DMA buffers, ensuring proper freeing of buffers with +dma_free_noncoherent(). + +Error log: +[ 10.194343] ath11k_pci 0000:04:00.0: swiotlb buffer is full (sz:1048583 bytes), total 32768 (slots), used 2529 (slots) +[ 10.194406] ath11k_pci 0000:04:00.0: failed to set up tcl_comp ring (0) :-12 +[ 10.194781] ath11k_pci 0000:04:00.0: failed to init DP: -12 + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 + +Reported-by: Tim Harvey +Closes: https://lore.kernel.org/all/20241210041133.GA17116@lst.de/ +Signed-off-by: P Praneesh +Tested-by: Tim Harvey +Link: https://patch.msgid.link/20250119164219.647059-2-quic_ppranees@quicinc.com +Signed-off-by: Jeff Johnson +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: BSD-3-Clause-Clear + /* + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. +- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. ++ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ + + #include +@@ -104,14 +104,12 @@ void ath11k_dp_srng_cleanup(struct ath11 + if (!ring->vaddr_unaligned) + return; + +- if (ring->cached) { +- dma_unmap_single(ab->dev, ring->paddr_unaligned, ring->size, +- DMA_FROM_DEVICE); +- kfree(ring->vaddr_unaligned); +- } else { ++ if (ring->cached) ++ dma_free_noncoherent(ab->dev, ring->size, ring->vaddr_unaligned, ++ ring->paddr_unaligned, DMA_FROM_DEVICE); ++ else + dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned, + ring->paddr_unaligned); +- } + + ring->vaddr_unaligned = NULL; + } +@@ -249,25 +247,14 @@ int ath11k_dp_srng_setup(struct ath11k_b + default: + cached = false; + } +- +- if (cached) { +- ring->vaddr_unaligned = kzalloc(ring->size, GFP_KERNEL); +- if (!ring->vaddr_unaligned) +- return -ENOMEM; +- +- ring->paddr_unaligned = dma_map_single(ab->dev, +- ring->vaddr_unaligned, +- ring->size, +- DMA_FROM_DEVICE); +- if (dma_mapping_error(ab->dev, ring->paddr_unaligned)) { +- kfree(ring->vaddr_unaligned); +- ring->vaddr_unaligned = NULL; +- return -ENOMEM; +- } +- } + } + +- if (!cached) ++ if (cached) ++ ring->vaddr_unaligned = dma_alloc_noncoherent(ab->dev, ring->size, ++ &ring->paddr_unaligned, ++ DMA_FROM_DEVICE, ++ GFP_KERNEL); ++ else + ring->vaddr_unaligned = dma_alloc_coherent(ab->dev, ring->size, + &ring->paddr_unaligned, + GFP_KERNEL); diff --git a/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch b/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch new file mode 100644 index 0000000000..2257b06910 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch @@ -0,0 +1,255 @@ +wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation + +Currently, the driver allocates cacheable DMA buffers for the rx_tid +structure using kzalloc() and dma_map_single(). These buffers are +long-lived and can persist for the lifetime of the peer, which is not +advisable. Instead of using kzalloc() and dma_map_single() for allocating +cacheable DMA buffers, utilize the dma_alloc_noncoherent() helper for the +allocation of long-lived cacheable DMA buffers, such as the peer's rx_tid. +Since dma_alloc_noncoherent() returns unaligned physical and virtual +addresses, align them internally before use within the driver. This +ensures proper allocation of non-coherent memory through the kernel +helper. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 + +Signed-off-by: P Praneesh +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -1,7 +1,7 @@ + /* SPDX-License-Identifier: BSD-3-Clause-Clear */ + /* + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. +- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. ++ * Copyright (c) 2021-2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ + + #ifndef ATH11K_DP_H +@@ -20,7 +20,6 @@ struct ath11k_ext_irq_grp; + + struct dp_rx_tid { + u8 tid; +- u32 *vaddr; + dma_addr_t paddr; + u32 size; + u32 ba_win_sz; +@@ -37,6 +36,9 @@ struct dp_rx_tid { + /* Timer info related to fragments */ + struct timer_list frag_timer; + struct ath11k_base *ab; ++ u32 *vaddr_unaligned; ++ dma_addr_t paddr_unaligned; ++ u32 unaligned_size; + }; + + #define DP_REO_DESC_FREE_THRESHOLD 64 +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: BSD-3-Clause-Clear + /* + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. +- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. ++ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ + + #include +@@ -675,11 +675,11 @@ void ath11k_dp_reo_cmd_list_cleanup(stru + list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) { + list_del(&cmd->list); + rx_tid = &cmd->data; +- if (rx_tid->vaddr) { +- dma_unmap_single(ab->dev, rx_tid->paddr, +- rx_tid->size, DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ if (rx_tid->vaddr_unaligned) { ++ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + kfree(cmd); + } +@@ -689,11 +689,11 @@ void ath11k_dp_reo_cmd_list_cleanup(stru + list_del(&cmd_cache->list); + dp->reo_cmd_cache_flush_count--; + rx_tid = &cmd_cache->data; +- if (rx_tid->vaddr) { +- dma_unmap_single(ab->dev, rx_tid->paddr, +- rx_tid->size, DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ if (rx_tid->vaddr_unaligned) { ++ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + kfree(cmd_cache); + } +@@ -708,11 +708,11 @@ static void ath11k_dp_reo_cmd_free(struc + if (status != HAL_REO_CMD_SUCCESS) + ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", + rx_tid->tid, status); +- if (rx_tid->vaddr) { +- dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ if (rx_tid->vaddr_unaligned) { ++ dma_free_noncoherent(dp->ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + } + +@@ -749,10 +749,10 @@ static void ath11k_dp_reo_cache_flush(st + if (ret) { + ath11k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", + rx_tid->tid, ret); +- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + } + +@@ -802,10 +802,10 @@ static void ath11k_dp_rx_tid_del_func(st + + return; + free_desc: +- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + + void ath11k_peer_rx_tid_delete(struct ath11k *ar, +@@ -831,14 +831,16 @@ void ath11k_peer_rx_tid_delete(struct at + if (ret != -ESHUTDOWN) + ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", + tid, ret); +- dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ dma_free_noncoherent(ar->ab->dev, rx_tid->unaligned_size, ++ rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + } + + rx_tid->paddr = 0; ++ rx_tid->paddr_unaligned = 0; + rx_tid->size = 0; ++ rx_tid->unaligned_size = 0; + } + + static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab, +@@ -982,10 +984,9 @@ static void ath11k_dp_rx_tid_mem_free(st + if (!rx_tid->active) + goto unlock_exit; + +- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, +- DMA_BIDIRECTIONAL); +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; ++ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, rx_tid->vaddr_unaligned, ++ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL); ++ rx_tid->vaddr_unaligned = NULL; + + rx_tid->active = false; + +@@ -1000,9 +1001,8 @@ int ath11k_peer_rx_tid_setup(struct ath1 + struct ath11k_base *ab = ar->ab; + struct ath11k_peer *peer; + struct dp_rx_tid *rx_tid; +- u32 hw_desc_sz; +- u32 *addr_aligned; +- void *vaddr; ++ u32 hw_desc_sz, *vaddr; ++ void *vaddr_unaligned; + dma_addr_t paddr; + int ret; + +@@ -1050,37 +1050,34 @@ int ath11k_peer_rx_tid_setup(struct ath1 + else + hw_desc_sz = ath11k_hal_reo_qdesc_size(DP_BA_WIN_SZ_MAX, tid); + +- vaddr = kzalloc(hw_desc_sz + HAL_LINK_DESC_ALIGN - 1, GFP_ATOMIC); +- if (!vaddr) { ++ rx_tid->unaligned_size = hw_desc_sz + HAL_LINK_DESC_ALIGN - 1; ++ vaddr_unaligned = dma_alloc_noncoherent(ab->dev, rx_tid->unaligned_size, &paddr, ++ DMA_BIDIRECTIONAL, GFP_ATOMIC); ++ if (!vaddr_unaligned) { + spin_unlock_bh(&ab->base_lock); + return -ENOMEM; + } + +- addr_aligned = PTR_ALIGN(vaddr, HAL_LINK_DESC_ALIGN); +- +- ath11k_hal_reo_qdesc_setup(addr_aligned, tid, ba_win_sz, +- ssn, pn_type); +- +- paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, +- DMA_BIDIRECTIONAL); +- +- ret = dma_mapping_error(ab->dev, paddr); +- if (ret) { +- spin_unlock_bh(&ab->base_lock); +- ath11k_warn(ab, "failed to setup dma map for peer %pM rx tid %d: %d\n", +- peer_mac, tid, ret); +- goto err_mem_free; +- } +- +- rx_tid->vaddr = vaddr; +- rx_tid->paddr = paddr; ++ rx_tid->vaddr_unaligned = vaddr_unaligned; ++ vaddr = PTR_ALIGN(vaddr_unaligned, HAL_LINK_DESC_ALIGN); ++ rx_tid->paddr_unaligned = paddr; ++ rx_tid->paddr = rx_tid->paddr_unaligned + ((unsigned long)vaddr - ++ (unsigned long)rx_tid->vaddr_unaligned); ++ ath11k_hal_reo_qdesc_setup(vaddr, tid, ba_win_sz, ssn, pn_type); + rx_tid->size = hw_desc_sz; + rx_tid->active = true; + ++ /* After dma_alloc_noncoherent, vaddr is being modified for reo qdesc setup. ++ * Since these changes are not reflected in the device, driver now needs to ++ * explicitly call dma_sync_single_for_device. ++ */ ++ dma_sync_single_for_device(ab->dev, rx_tid->paddr, ++ rx_tid->size, ++ DMA_TO_DEVICE); + spin_unlock_bh(&ab->base_lock); + +- ret = ath11k_wmi_peer_rx_reorder_queue_setup(ar, vdev_id, peer_mac, +- paddr, tid, 1, ba_win_sz); ++ ret = ath11k_wmi_peer_rx_reorder_queue_setup(ar, vdev_id, peer_mac, rx_tid->paddr, ++ tid, 1, ba_win_sz); + if (ret) { + ath11k_warn(ar->ab, "failed to setup rx reorder queue for peer %pM tid %d: %d\n", + peer_mac, tid, ret); +@@ -1088,12 +1085,6 @@ int ath11k_peer_rx_tid_setup(struct ath1 + } + + return ret; +- +-err_mem_free: +- kfree(rx_tid->vaddr); +- rx_tid->vaddr = NULL; +- +- return ret; + } + + int ath11k_dp_rx_ampdu_start(struct ath11k *ar,