From 0e29e05deed1edd3884ca888ae7e1b549c84bfd0 Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Thu, 24 Jun 2021 13:10:09 +0200 Subject: [PATCH 1/4] kirkwood: increase kernel partition of Linksyses At this moment kernel partition in Linksyses EA3500/E4200/EA4500 is ended before start of rootfs partition. It was introduced in 9808b9ae02 and it broke easy revert to stock. Sysupgrade, when OFW is used, write whole stock image to kernel partition. Most likeley image will be bigger than small kernel partition and it make stock system invalid. This patch change size of kernel partitions and now it overlaps rootfs. Revert to stock will be possible again. Fixes: 9808b9ae02 ("kirkwood: switch to kernel 4.9") Signed-off-by: Pawel Dembicki --- .../files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts | 4 ++-- .../linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts index b41243d8dd..b911138541 100644 --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts @@ -165,7 +165,7 @@ partition@200000 { label = "kernel1"; - reg = <0x200000 0x290000>; + reg = <0x200000 0x1400000>; }; partition@490000 { @@ -175,7 +175,7 @@ partition@1600000 { label = "kernel2"; - reg = <0x1600000 0x290000>; + reg = <0x1600000 0x1400000>; }; partition@1890000 { diff --git a/target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch b/target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch index 0d97ad14a2..0933b567e4 100644 --- a/target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch +++ b/target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch @@ -28,8 +28,9 @@ partition@200000 { - label = "kernel"; +- reg = <0x200000 0x2A0000>; + label = "kernel1"; - reg = <0x200000 0x2A0000>; ++ reg = <0x200000 0x1A00000>; }; partition@4a0000 { @@ -40,8 +41,9 @@ partition@1c00000 { - label = "alt_kernel"; +- reg = <0x1C00000 0x2A0000>; + label = "kernel2"; - reg = <0x1C00000 0x2A0000>; ++ reg = <0x1C00000 0x1A00000>; }; partition@1ea0000 { From f11cdd30065b241e51283a205dfc951d677e183b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 12 Sep 2021 12:56:48 +0200 Subject: [PATCH 2/4] build: Replace KERNEL_LOCKUP_DETECTOR with KERNEL_SOFTLOCKUP_DETECTOR The LOCKUP_DETECTOR configuration option split into the SOFTLOCKUP_DETECTOR and HARDLOCKUP_DETECTOR configuration option some time ago. The HARDLOCKUP_DETECTOR option is only working on some architectures, but SOFTLOCKUP_DETECTOR should work everywhere. Replace KERNEL_LOCKUP_DETECTOR with KERNEL_SOFTLOCKUP_DETECTOR. LOCKUP_DETECTOR will be selected by SOFTLOCKUP_DETECTOR automatically. Fixes: b951f53fbae3 ("build: Add additional kernel debug options") Signed-off-by: Hauke Mehrtens (cherry picked from commit d27f6e2c5d2a2315cc8fe684d117c80aa9984ca8) --- config/Config-kernel.in | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index f71114b5da..d4648a5064 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -436,34 +436,22 @@ config KERNEL_PROVE_LOCKING select KERNEL_DEBUG_KERNEL default n -config KERNEL_LOCKUP_DETECTOR - bool "Compile the kernel with detect Hard and Soft Lockups" +config KERNEL_SOFTLOCKUP_DETECTOR + bool "Compile the kernel with detect Soft Lockups" depends on KERNEL_DEBUG_KERNEL help Say Y here to enable the kernel to act as a watchdog to detect - hard and soft lockups. + soft lockups. Softlockups are bugs that cause the kernel to loop in kernel mode for more than 20 seconds, without giving other tasks a chance to run. The current stack trace is displayed upon detection and the system will stay locked up. - Hardlockups are bugs that cause the CPU to loop in kernel mode - for more than 10 seconds, without letting other interrupts have a - chance to run. The current stack trace is displayed upon detection - and the system will stay locked up. - - The overhead should be minimal. A periodic hrtimer runs to - generate interrupts and kick the watchdog task every 4 seconds. - An NMI is generated every 10 seconds or so to check for hardlockups. - - The frequency of hrtimer and NMI events and the soft and hard lockup - thresholds can be controlled through the sysctl watchdog_thresh. - config KERNEL_DETECT_HUNG_TASK bool "Compile the kernel with detect Hung Tasks" depends on KERNEL_DEBUG_KERNEL - default KERNEL_LOCKUP_DETECTOR + default KERNEL_SOFTLOCKUP_DETECTOR help Say Y here to enable the kernel to detect "hung tasks", which are bugs that cause the task to be stuck in From a300e3c89027d247f2c31d88c3e6d720e61cbb05 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 12 Sep 2021 13:05:30 +0200 Subject: [PATCH 3/4] kernel: Add missing kernel config options These options are selectable when some of the kernel debug options like KERNEL_SOFTLOCKUP_DETECTOR are selected. Signed-off-by: Hauke Mehrtens (cherry picked from commit 1a3b3dc7974c98843baeb22251dc4c580dc771d6) --- target/linux/archs38/config-5.4 | 1 - target/linux/generic/config-5.4 | 3 +++ target/linux/layerscape/armv7/config-5.4 | 2 -- target/linux/layerscape/armv8_64b/config-5.4 | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/target/linux/archs38/config-5.4 b/target/linux/archs38/config-5.4 index 29246265ad..20c3dc0a88 100644 --- a/target/linux/archs38/config-5.4 +++ b/target/linux/archs38/config-5.4 @@ -50,7 +50,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BLK_SCSI_REQUEST=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y CONFIG_CC_HAS_KASAN_GENERIC=y diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 50e627297e..680f0d0feb 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -644,6 +644,8 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOT_PRINTK_DELAY is not set CONFIG_BOOT_RAW=y CONFIG_BPF=y @@ -1239,6 +1241,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_NOOP is not set diff --git a/target/linux/layerscape/armv7/config-5.4 b/target/linux/layerscape/armv7/config-5.4 index 35c8eed8da..3189724fd1 100644 --- a/target/linux/layerscape/armv7/config-5.4 +++ b/target/linux/layerscape/armv7/config-5.4 @@ -104,7 +104,6 @@ CONFIG_BLK_MQ_PCI=y CONFIG_BLK_MQ_VIRTIO=y CONFIG_BLK_PM=y CONFIG_BLK_SCSI_REQUEST=y -# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 CONFIG_BOUNCE=y CONFIG_BRCMSTB_GISB_ARB=y @@ -202,7 +201,6 @@ CONFIG_DECOMPRESS_GZIP=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DETECT_HUNG_TASK=y # CONFIG_DEVFREQ_GOV_PASSIVE is not set # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index ce619ac6c1..1dbcc845ac 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -130,7 +130,6 @@ CONFIG_BLK_MQ_PCI=y CONFIG_BLK_MQ_VIRTIO=y CONFIG_BLK_PM=y CONFIG_BLK_SCSI_REQUEST=y -# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y @@ -224,7 +223,6 @@ CONFIG_DECOMPRESS_GZIP=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DETECT_HUNG_TASK=y # CONFIG_DEVICE_THERMAL is not set CONFIG_DEVTMPFS=y From c37a9e506c6e53c80fe37a8eb7ac435eb966fa76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Sun, 29 Aug 2021 21:21:35 +0200 Subject: [PATCH 4/4] kernel: backport switchdev fix for bridge in bridge configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes the forwarding behavior of bridge in bridge configurations with DSA. Without it, the configuration of the upper bridge might overwrite settings of the lower bridge. For example, a vlan-aware bridge with DSA interfaces in it might be offloaded to the DSA hardware. If the bridge interface itself gets slave of a different bridge without vlan filtering, the vlan filtering setting of the lower bridge is overwritten by the upper bridge, which results in an incorrect hardware configuration. This was backported from kernel 5.7. Ref: https://lore.kernel.org/netdev/20191222192235.GK25745@shell.armlinux.org.uk/ Fixes: FS#3996 Signed-off-by: Fabian Bläse (cherry picked from commit c50ece58c41647880cc74c927d98b465cdfbdad8) --- ...-not-propagate-bridge-updates-across.patch | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch diff --git a/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch b/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch new file mode 100644 index 0000000000..bc8014b772 --- /dev/null +++ b/target/linux/generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch @@ -0,0 +1,60 @@ +From 07c6f9805f12f1bb538ef165a092b300350384aa Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Wed, 26 Feb 2020 17:14:21 +0000 +Subject: [PATCH] net: switchdev: do not propagate bridge updates across + bridges + +When configuring a tree of independent bridges, propagating changes +from the upper bridge across a bridge master to the lower bridge +ports brings surprises. + +For example, a lower bridge may have vlan filtering enabled. It +may have a vlan interface attached to the bridge master, which may +then be incorporated into another bridge. As soon as the lower +bridge vlan interface is attached to the upper bridge, the lower +bridge has vlan filtering disabled. + +This occurs because switchdev recursively applies its changes to +all lower devices no matter what. + +Reviewed-by: Ido Schimmel +Tested-by: Ido Schimmel +Signed-off-by: Russell King +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + net/switchdev/switchdev.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/switchdev/switchdev.c ++++ b/net/switchdev/switchdev.c +@@ -476,6 +476,9 @@ static int __switchdev_handle_port_obj_a + * necessary to go through this helper. + */ + netdev_for_each_lower_dev(dev, lower_dev, iter) { ++ if (netif_is_bridge_master(lower_dev)) ++ continue; ++ + err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info, + check_cb, add_cb); + if (err && err != -EOPNOTSUPP) +@@ -528,6 +531,9 @@ static int __switchdev_handle_port_obj_d + * necessary to go through this helper. + */ + netdev_for_each_lower_dev(dev, lower_dev, iter) { ++ if (netif_is_bridge_master(lower_dev)) ++ continue; ++ + err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info, + check_cb, del_cb); + if (err && err != -EOPNOTSUPP) +@@ -579,6 +585,9 @@ static int __switchdev_handle_port_attr_ + * necessary to go through this helper. + */ + netdev_for_each_lower_dev(dev, lower_dev, iter) { ++ if (netif_is_bridge_master(lower_dev)) ++ continue; ++ + err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info, + check_cb, set_cb); + if (err && err != -EOPNOTSUPP)