From 63db906516013b9593b59d09b0dc49149a323da7 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 31 Oct 2022 17:53:50 +0100 Subject: [PATCH 01/10] odhcpd: update to git HEAD a92c0a7 dhcpv6-ia: make tmp lease file hidden 4a673e1 fix null pointer dereference for INFORM messages 860ca90 odhcpd: Support for Option NTP and SNTP Signed-off-by: Hans Dedecker --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 21c87eaad4..8f4799a373 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2022-03-22 -PKG_SOURCE_VERSION:=860ca900e41c5d0f98cc85e67b39977f6f2cb355 -PKG_MIRROR_HASH:=555712a1e25d197e52808a0d5e42bf0d48a8b61fe7c8aad1a02a7c09f0b8b8a3 +PKG_SOURCE_DATE:=2022-10-31 +PKG_SOURCE_VERSION:=a92c0a73d018cd6453dcf253d9617f97311becab +PKG_MIRROR_HASH:=0752d500b4aa65290c46be89ac5c30a0d536f6695c04ee79201cbada0880ed9c PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 23a456aef1ac5c66f7bc5dc45ba2bc5980dbc513 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 26 Oct 2022 10:43:19 +0200 Subject: [PATCH 02/10] expat: update to 2.5.0 Fixes CVE-2022-43680. Changes: https://github.com/libexpat/libexpat/blob/R_2_5_0/expat/Changes Signed-off-by: Nick Hainke --- tools/expat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 22acf45e08..c1a8cb8d97 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.4.9 +PKG_VERSION:=2.5.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=6e8c0728fe5c7cd3f93a6acce43046c5e4736c7b4b68e032e9350daa0efc0354 +PKG_HASH:=ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) HOST_BUILD_PARALLEL:=1 From da5c45f4d8864a82378b4a04c0516cb98a718cfa Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 19 Oct 2022 11:21:58 +0200 Subject: [PATCH 03/10] kernel: remove handling of xfrm[4|6]_mode_* modules For kernel versions before 5.2, the required IPsec modes have to be enabled explicitly (they are built-in for newer kernels). Commit 1556ed155a9a ("kernel: mode_beet mode_transport mode_tunnel xfram modules") tried to handle this, but it does not really work. Since we don't support these kernel versions anymore and the code is also broken, let's remove it. Signed-off-by: Martin Schiller [Remove old generic config options too] Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 14 ++------------ target/linux/generic/config-5.10 | 3 --- target/linux/generic/config-5.15 | 3 --- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 9afee41aed..0fc3b5cce3 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -215,10 +215,8 @@ $(eval $(call KernelPackage,ipsec)) IPSEC4-m = \ ipv4/ah4 \ ipv4/esp4 \ - ipv4/xfrm4_tunnel \ ipv4/ipcomp \ - -IPSEC4-m += $(ifeq ($$(strip $$(call CompareKernelPatchVer,$$(KERNEL_PATCHVER),le,5.2))),ipv4/xfrm4_mode_beet ipv4/xfrm4_mode_transport ipv4/xfrm4_mode_tunnel) + ipv4/xfrm4_tunnel define KernelPackage/ipsec4 SUBMENU:=$(NETWORK_SUPPORT_MENU) @@ -228,9 +226,6 @@ define KernelPackage/ipsec4 CONFIG_INET_AH \ CONFIG_INET_ESP \ CONFIG_INET_IPCOMP \ - CONFIG_INET_XFRM_MODE_BEET \ - CONFIG_INET_XFRM_MODE_TRANSPORT \ - CONFIG_INET_XFRM_MODE_TUNNEL \ CONFIG_INET_XFRM_TUNNEL \ CONFIG_INET_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC4-m),$(LINUX_DIR)/net/$(mod).ko) @@ -255,10 +250,8 @@ $(eval $(call KernelPackage,ipsec4)) IPSEC6-m = \ ipv6/ah6 \ ipv6/esp6 \ - ipv6/xfrm6_tunnel \ ipv6/ipcomp6 \ - -IPSEC6-m += $(ifeq ($$(strip $$(call CompareKernelPatchVer,$$(KERNEL_PATCHVER),le,5.2))),ipv6/xfrm6_mode_beet ipv6/xfrm6_mode_transport ipv6/xfrm6_mode_tunnel) + ipv6/xfrm6_tunnel define KernelPackage/ipsec6 SUBMENU:=$(NETWORK_SUPPORT_MENU) @@ -268,9 +261,6 @@ define KernelPackage/ipsec6 CONFIG_INET6_AH \ CONFIG_INET6_ESP \ CONFIG_INET6_IPCOMP \ - CONFIG_INET6_XFRM_MODE_BEET \ - CONFIG_INET6_XFRM_MODE_TRANSPORT \ - CONFIG_INET6_XFRM_MODE_TUNNEL \ CONFIG_INET6_XFRM_TUNNEL \ CONFIG_INET6_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC6-m),$(LINUX_DIR)/net/$(mod).ko) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index cef0c7d0a8..4b2837de05 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2554,9 +2554,6 @@ CONFIG_INET=y # CONFIG_INET_TCP_DIAG is not set # CONFIG_INET_TUNNEL is not set # CONFIG_INET_UDP_DIAG is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set # CONFIG_INET_XFRM_TUNNEL is not set # CONFIG_INFINIBAND is not set # CONFIG_INFTL is not set diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 8b2d6b5491..1e49471ae2 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -2655,9 +2655,6 @@ CONFIG_INET=y # CONFIG_INET_TCP_DIAG is not set # CONFIG_INET_TUNNEL is not set # CONFIG_INET_UDP_DIAG is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set # CONFIG_INET_XFRM_TUNNEL is not set # CONFIG_INFINIBAND is not set # CONFIG_INFTL is not set From 06e34a05f9e96d319d426d9bbbfebea9a62cac07 Mon Sep 17 00:00:00 2001 From: Raihaan Shouhell Date: Sat, 22 Oct 2022 21:10:34 +0800 Subject: [PATCH 04/10] tools/ccache: update to 4.7 Release Notes: https://ccache.dev/releasenotes.html#_ccache_4_7 Signed-off-by: Raihaan Shouhell --- tools/ccache/Makefile | 4 ++-- tools/ccache/patches/100-honour-copts.patch | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 0cf528bb5f..644aa3b5e8 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.6.3 +PKG_VERSION:=4.7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=1e3a251bb112632553b8255a78661fe526c3a16598496d51128c32b218fd8b22 +PKG_HASH:=d9283bbe22085268f52d309b91adb81a77a7abe10867eb6852057910ffac736a include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index c8f2fc0fe6..6a4834e123 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,10 +1,10 @@ --- a/src/ccache.cpp +++ b/src/ccache.cpp -@@ -1756,6 +1756,7 @@ calculate_result_and_manifest_key(Contex - "CPLUS_INCLUDE_PATH", - "OBJC_INCLUDE_PATH", - "OBJCPLUS_INCLUDE_PATH", // clang -+ "GCC_HONOUR_COPTS", - nullptr}; - for (const char** p = envvars; *p; ++p) { - const char* v = getenv(*p); +@@ -1743,6 +1743,7 @@ get_manifest_key(Context& ctx, Hash& hash) + "CPLUS_INCLUDE_PATH", + "OBJC_INCLUDE_PATH", + "OBJCPLUS_INCLUDE_PATH", // clang ++ "GCC_HONOUR_COPTS", + nullptr}; + for (const char** p = envvars; *p; ++p) { + const char* v = getenv(*p); From c1c4a5e007db6178a9c7c85e11104d21a7535faf Mon Sep 17 00:00:00 2001 From: Raihaan Shouhell Date: Mon, 24 Oct 2022 01:01:25 +0800 Subject: [PATCH 05/10] tools/ccache: update to 4.7.1 Release Notes: https://ccache.dev/releasenotes.html#_ccache_4_7_1 Signed-off-by: Raihaan Shouhell --- tools/ccache/Makefile | 4 ++-- tools/ccache/patches/100-honour-copts.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 644aa3b5e8..4a009d9765 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.7 +PKG_VERSION:=4.7.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=d9283bbe22085268f52d309b91adb81a77a7abe10867eb6852057910ffac736a +PKG_HASH:=04ccc746524cb7fb914ccdfc66e7c54504204afee0e270ac75e8f66196521b6d include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index 6a4834e123..b4c1be4df3 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,6 +1,6 @@ --- a/src/ccache.cpp +++ b/src/ccache.cpp -@@ -1743,6 +1743,7 @@ get_manifest_key(Context& ctx, Hash& hash) +@@ -1762,6 +1762,7 @@ get_manifest_key(Context& ctx, Hash& hash) "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH", // clang From 7fd764dc5225e853e732cc091533dbaee6dc5419 Mon Sep 17 00:00:00 2001 From: Raihaan Shouhell Date: Mon, 31 Oct 2022 11:16:57 +0800 Subject: [PATCH 06/10] tools/ccache: update to 4.7.2 Release Notes: https://ccache.dev/releasenotes.html#_ccache_4_7_2 Signed-off-by: Raihaan Shouhell --- tools/ccache/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 4a009d9765..6d92c2f141 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.7.1 +PKG_VERSION:=4.7.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=04ccc746524cb7fb914ccdfc66e7c54504204afee0e270ac75e8f66196521b6d +PKG_HASH:=17ca75a577d49c1e4f2ac86d53126859de52b789cfe85dd532758518db114eaf include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 08e153c3c31a117de0d47586ea7ab720ef95104b Mon Sep 17 00:00:00 2001 From: Volodymyr Puiul Date: Wed, 22 Jun 2022 16:41:36 +0400 Subject: [PATCH 07/10] ramips: add support for YunCore FAP690 It is an in-wall 802.11ax (Wi-Fi 6) router, based on MediaTek MT7621A. Specifications: - SoC: MT7621AT (880MHz, 2 Cores) - RAM: 128 MB - Flash: 16 MB SPI NOR - Wi-Fi: - MT7915DN + MT7905DAN: 2.4/5 GHz - Ethernet: 1x 1GiE via MT7530 - UART: J4 (115200 baud) - Pinout: [3V3] (TXD) (RXD) (GND) - Bootloader: U-Boot - Buttons: - SW1 - no label on the box, combined with led - Led: Status. RGB controlled by - GPIO 14 - green color - GPIO 15 - red color - GPIO 16 - blue color Installation: OEM firmware is based on LEDE with custom UI and support standard sysupgrade variant of firmware. However it requires "*.ubin" extension for sysupgrade file. Always select "Factory reset" switch on upgrade to OpenWRT, otherwise it will not boot. MAC addresses as verified by OEM firmware: vendor source LAN factory 0x4 (label) 5g factory 0x4 (label) 2g label with flipped bits bit in 1-st byte and bits 5, 6, 7 in 4-th byte Example label: 44:xx:xx:b7:xx:xx lan: 44:xx:xx:b7:xx:xx 2g 46:xx:xx:c7:xx:xx 5g 44:xx:xx:b7:xx:xx Signed-off-by: Volodymyr Puiul --- .../ramips/dts/mt7621_yuncore_fap690.dts | 149 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 +- 5 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_yuncore_fap690.dts diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts new file mode 100644 index 0000000000..a998b95d4c --- /dev/null +++ b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "yuncore,fap690", "mediatek,mt7621-soc"; + model = "YunCore FAP690"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <200>; + always-running; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Config"; + reg = <0x30000 0x10000>; + read-only; + }; + + /* range 0x40000 to 0x50000 is empty in vendor + * firmware, so we do not use it either + */ + + factory: partition@50000 { + label = "Factory"; + reg = <0x50000 0x40000>; + read-only; + }; + + partition@90000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x90000 0xf70000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + mediatek,disable-radar-background; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_0004>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@4 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "wdt"; + function = "gpio"; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 46b30f01af..3ef4cf4efb 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2273,6 +2273,16 @@ define Device/yuncore_fap640 endef TARGET_DEVICES += yuncore_fap640 +define Device/yuncore_fap690 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15808k + DEVICE_VENDOR := YunCore + DEVICE_MODEL := FAP690 + DEVICE_PACKAGES := kmod-mt7915e +endef +TARGET_DEVICES += yuncore_fap690 + define Device/zbtlink_zbt-we1326 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 5ffa4ecb3a..c2bc9c3774 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -170,6 +170,9 @@ xiaomi,redmi-router-ac2100) youhua,wr1200js) ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan" ;; +yuncore,fap690) + ucidef_set_led_netdev "eth_link" "LAN link" "blue:status" "lan" "link" + ;; yuncore,ax820) ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 0a05017fd7..39af3af219 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -24,6 +24,7 @@ ramips_setup_interfaces() ubnt,unifi-6-lite|\ ubnt,unifi-flexhd|\ ubnt,unifi-nanohd|\ + yuncore,fap690|\ zyxel,nwa50ax|\ zyxel,nwa55axe) ucidef_set_interface_lan "lan" diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index ca69745ba6..ff3ee281b2 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -126,7 +126,8 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress ;; - yuncore,fap640) + yuncore,fap640|\ + yuncore,fap690) hw_mac_addr="$(mtd_get_mac_binary Factory 0x4)" [ "$PHYNBR" = "0" ] && macaddr_setbit_la "$hw_mac_addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && echo -n "$hw_mac_addr" > /sys${DEVPATH}/macaddress From e131a66e307cb108443714e9d57c1eeca12194a1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 31 Oct 2022 19:50:40 +0000 Subject: [PATCH 08/10] mediatek: consider adc_oe thermal calibration value in efuse The use of the adc_oe value stored in the efuse has been dropped in MediaTek's SDK during a recent refactorization of the temperature calculation formula. Don't ignore this offset value and again include it in raw-to-deg-celsius calculation. Signed-off-by: Daniel Golle --- ...5-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch b/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch index ed72f78009..7ec962a7c3 100644 --- a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch +++ b/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch @@ -131,7 +131,7 @@ Signed-off-by: Daniel Golle + tmp = 100000 * 15 / 16 * 10000; + tmp /= 4096 - 512 + mt->adc_ge; + tmp /= 1490; -+ tmp *= raw - mt->vts[sensno] - 2900; ++ tmp *= raw - mt->vts[sensno] - 2900 - mt->adc_oe + 512; + + return mt->degc_cali * 500 - tmp; +} From 3b936510720b04ec02b4e4a395aa39cdcfbc47d5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 30 Oct 2022 12:25:19 -0700 Subject: [PATCH 09/10] target/realtek: use netif_receive_skb_list Small performance improvement on rx. Signed-off-by: Rosen Penev --- .../realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index be84549b9e..166e49e139 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -1252,6 +1252,7 @@ static int rtl838x_hw_receive(struct net_device *dev, int r, int budget) struct rtl838x_eth_priv *priv = netdev_priv(dev); struct ring_b *ring = priv->membase; struct sk_buff *skb; + LIST_HEAD(rx_list); unsigned long flags; int i, len, work_done = 0; u8 *data, *skb_data; @@ -1329,7 +1330,7 @@ static int rtl838x_hw_receive(struct net_device *dev, int r, int budget) dev->stats.rx_packets++; dev->stats.rx_bytes += len; - netif_receive_skb(skb); + list_add_tail(&skb->list, &rx_list); } else { if (net_ratelimit()) dev_warn(&dev->dev, "low on memory - packet dropped\n"); @@ -1347,6 +1348,8 @@ static int rtl838x_hw_receive(struct net_device *dev, int r, int budget) last = (u32 *)KSEG1ADDR(sw_r32(priv->r->dma_if_rx_cur + r * 4)); } while (&ring->rx_r[r][ring->c_rx[r]] != last && work_done < budget); + netif_receive_skb_list(&rx_list); + // Update counters priv->r->update_cntr(r, 0); From 75c576d4c4763785c665e3211b17868b3ed8e819 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Mon, 31 Oct 2022 10:11:04 +0100 Subject: [PATCH 10/10] realtek: mark clock source as continuous After replacing the R4K event timer and clock source with the new Realtek Otto timer, performance for RTL839x devices was severely impacted, as reported by Hiroshi. Research by Markus showed that after commit 4657a5301eb5 ("realtek: avoid busy waiting for RTL839x PHY read/write"), the ethernet driver could only update a phy once per timer interval, which also heavily impacted boot time. On e.g. a Zyxel GS1900-48, this added around a minute to the time to fully initialise the switch. By marking the otto clocksource as continuous, the kernel enables it to be used for high resolution timers. This allows readx_poll_timeout() to sleep for less than one system timer interval, reducing system dead time. Link: https://github.com/openwrt/openwrt/issues/11117 Reported-by: INAGAKI Hiroshi Cc: Markus Stockhausen Signed-off-by: Sander Vanheule Tested-by: INAGAKI Hiroshi # Panasonic Switch-M48eG PN28480K Tested-by: Jan Hoffmann # HPE 1920-8G, HPE 1920-48G --- .../realtek/files-5.10/drivers/clocksource/timer-rtl-otto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/realtek/files-5.10/drivers/clocksource/timer-rtl-otto.c b/target/linux/realtek/files-5.10/drivers/clocksource/timer-rtl-otto.c index 12eed78653..14e28e50f4 100644 --- a/target/linux/realtek/files-5.10/drivers/clocksource/timer-rtl-otto.c +++ b/target/linux/realtek/files-5.10/drivers/clocksource/timer-rtl-otto.c @@ -227,6 +227,7 @@ struct rttm_cs rttm_cs = { .name = "realtek_otto_timer", .rating = 400, .mask = CLOCKSOURCE_MASK(RTTM_BIT_COUNT), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, .read = rttm_read_clocksource, .enable = rttm_enable_clocksource }