Skip to content

[RFC][RFT] ramips: mt7621: initial 5.4 support - #2798

Closed
dengqf6 wants to merge 26 commits into
openwrt:masterfrom
dengqf6:ramips-5.4
Closed

dengqf6 wants to merge 26 commits into
openwrt:masterfrom
dengqf6:ramips-5.4

Conversation

@dengqf6

@dengqf6 dengqf6 commented Mar 1, 2020 •

Copy link
Copy Markdown

Run tested on:

  • Newifi D1/D2 (MT7621 SPI-NOR)
  • MiWiFi R3G v1 (MT7621 NAND)
  • Ubiquiti ER-X-SFP (MT7621 NAND, needs some patches to make SFP work, see @vDorst's branch)

Working:

  • I2C
  • GPIO
  • PCIe (Wireless)
  • SPI
  • NAND
  • Ethernet
  • USB

Known issues:

  • MT7621 HWNAT is not available yet.
  • Previous configuration that uses swconfig is incompatible with DSA. Ethernet won't work if users update to this version with "preserve configuration".

@dengqf6
dengqf6 force-pushed the ramips-5.4 branch 2 times, most recently from 5bac6d7 to 0a9c2a9 Compare March 1, 2020 09:44
@dchard

dchard commented Mar 1, 2020

Copy link
Copy Markdown
Contributor

Given the fact the 5.4 mt_7530 driver might finally fix the long outstanding "Mtk_soc_eth watchdog timeout" issue, it might be worth focusing on this instead of the 4.19 merge.
It is great to see that you are working on it, hope I can test it soon on my 860L B1 (mt7621).

@dengqf6
dengqf6 force-pushed the ramips-5.4 branch 2 times, most recently from 3907c6f to fc1d6ea Compare March 1, 2020 21:18
@neheb

neheb commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

Very unfortunate that the mmc driver is not being retired.

e424654 is a complete no-go. It's also worthless. GCC AFAIK compiles the code the same whether 24kc or 1004kc.

I have mixed feelings about fac672e .

On the one hand, the upstream driver should definitely be used. On the other, this gets rid of HNAT capability. DSA also happens to be slower.

@dchard

dchard commented Mar 2, 2020 •

Copy link
Copy Markdown
Contributor

@neheb

If the driver switch fixes the stability issue at the expense of HW NAT (which is not working on 4.14 neither), but will operate in a stable manner at least with SW offload, that would be a reasonable tradeoff in my opinion.

On the HW NAT side: does this means it will never work, or it means someone needs to port the HW NAT code for the new driver?

@neheb

neheb commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

Just means someone needs to write support for it with the mainline driver. Possibly @blogic . OTOH I wonder if even software flow offload can do gigabit routing.

I would guess the main concern is non-mt7621 devices, which are slower.

The mainline driver also currently lacks support for the other platforms supported by ramips. IIRC, only mt7621 and mt7628 are supported. There's also mt7620 and the rt series.

@981213

981213 commented Mar 2, 2020

Copy link
Copy Markdown
Member

@blogic mentioned once on IRC that he already has a 5.4 support for ramips lying around.

@dengqf6

dengqf6 commented Mar 2, 2020 •

Copy link
Copy Markdown
Author

I think the reason mtd-mac-address does not work on eth0 is that mtk_soc_eth is probed too early, before mtd:

[    0.897162] mtk_soc_eth 1e100000.ethernet: generated random MAC address 72:aa:9d:ee:53:00
...
[    0.921744] mt7621-nand: NAND register bank at 0xbe003000
[    0.927163] mt7621-nand: ECC register bank at 0xbe003800

How to defer it?

Update: fixed by moving mt7621-nand into drivers/mtd

@xback

xback commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

@dengqf6
Build as module?

@dengqf6

dengqf6 commented Mar 2, 2020

Copy link
Copy Markdown
Author

OTOH I wonder if even software flow offload can do gigabit routing.

With sw offload, iperf3 LAN->WAN throughput is 900Mbps, but WAN->LAN is only 600Mbps, probably because of the RX path bug that @hackpascal and @vDorst mentioned.

@mrkiko

mrkiko commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

thank you very very Much!!

@ynezz ynezz added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target work in progress pull request the author is still working on RFC pull request ready for comments RFT pull request ready for testing labels Mar 2, 2020
@dengqf6

dengqf6 commented Mar 2, 2020

Copy link
Copy Markdown
Author

@dchard I've pushed new profile. Could you please test it on your 860L B1?

@LynxChaus

Copy link
Copy Markdown
Contributor

How to defer it?

Return -EPROBE_DEFER when probing?

@dchard

dchard commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

@dchard I've pushed new profile. Could you please test it on your 860L B1?

Happy to do that, but someone need to build an image for me what I can load on the device.

@xabolcs

xabolcs commented Mar 3, 2020 •

Copy link
Copy Markdown
Contributor

Happy to do that, but someone need to build an image for me what I can load on the device.

Here you are, @dchard !
pr-2798-dir-860l-c4f22de366e-into-0493d57e0477.targ.gz Forgot to switch kernel! 🙃

Didn't test, just built this pr (at c4f22de366e) merged into master (at 0493d57).

$ tar -cvzf pr-2798-dir-860l-c4f22de366e7601beb70ed4b54ea985cc6651fa6-into-0493d57e04774d47921a7d2014b567455d5dc16b.targ.gz bin/targets/ramips/mt7621
bin/targets/ramips/mt7621/
bin/targets/ramips/mt7621/openwrt-ramips-mt7621-dlink_dir-860l-b1-squashfs-sysupgrade.bin
bin/targets/ramips/mt7621/version.buildinfo
bin/targets/ramips/mt7621/openwrt-ramips-mt7621-dlink_dir-860l-b1-squashfs-factory.bin
bin/targets/ramips/mt7621/openwrt-ramips-mt7621-dlink_dir-860l-b1-initramfs-kernel.bin
bin/targets/ramips/mt7621/openwrt-ramips-mt7621-dlink_dir-860l-b1.manifest
bin/targets/ramips/mt7621/packages/
bin/targets/ramips/mt7621/packages/kmod-ipt-conntrack_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-mt76-core_5.4.22+2020-02-25-81476f11-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/fwtool_2019-11-12-8f7fe925-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nls-base_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libpthread_1.1.24-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-ipt-offload_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-leds-gpio_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-ipt-nat_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-slhc_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-mac80211_5.4.22+5.4-rc8-1-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-usb-ledtrig-usbport_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/mtd_25_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/Packages.manifest
bin/targets/ramips/mt7621/packages/kmod-ppp_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-pppox_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-flow_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libiwinfo20200105_2020-01-05-bf2c1069-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/iptables_1.8.3-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-lib-crc-ccitt_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-mt76x2_5.4.22+2020-02-25-81476f11-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-cfg80211_5.4.22+5.4-rc8-1-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/Packages.sig
bin/targets/ramips/mt7621/packages/ubi-utils_2.1.1-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-pppoe_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-reject6_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libip6tc2_1.8.3-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/ip6tables_1.8.3-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-ipt_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/iwinfo_2020-01-05-bf2c1069-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/Packages
bin/targets/ramips/mt7621/packages/kmod-usb-core_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-mt76x2-common_5.4.22+2020-02-25-81476f11-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-gpio-button-hotplug_5.4.22-3_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libgcc1_8.3.0-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-conntrack6_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-reject_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-ipt6_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-mt76x02-common_5.4.22+2020-02-25-81476f11-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-nat_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/Packages.gz
bin/targets/ramips/mt7621/packages/kmod-usb3_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-ipt-core_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libip4tc2_1.8.3-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-nf-conntrack_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/base-files_214-r12423+13-0493d57e04_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libc_1.1.24-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kmod-ip6tables_5.4.22-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/kernel_5.4.22-1-4d913e1fc1e2fb782fb3ade9db1e923c_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/libxtables12_1.8.3-2_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/packages/fstools_2020-01-21-deb745f8-1_mipsel_1004kc.ipk
bin/targets/ramips/mt7621/config.buildinfo
bin/targets/ramips/mt7621/feeds.buildinfo
bin/targets/ramips/mt7621/sha256sums

@dengqf6

dengqf6 commented Mar 3, 2020

Copy link
Copy Markdown
Author

Forgot to switch kernel

Isn't it already 5.4.22?

@xabolcs

xabolcs commented Mar 3, 2020 •

Copy link
Copy Markdown
Contributor

Isn't it already 5.4.22?

It isn't. I don't know as I didn't extracted / flashed the image, just built.

$ git diff
diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
index 887b5909e4..55a5ec6ee5 100644
--- a/target/linux/ramips/Makefile
+++ b/target/linux/ramips/Makefile
@@ -13,7 +13,7 @@ SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
 FEATURES:=squashfs gpio
 MAINTAINER:=John Crispin <[email protected]>
 
-KERNEL_PATCHVER:=4.14
+KERNEL_PATCHVER:=5.4
 
 define Target/Description
        Build firmware images for Ralink RT288x/RT3xxx based boards.

@xabolcs

xabolcs commented Mar 3, 2020

Copy link
Copy Markdown
Contributor

Here is the new build: c4f22de366e7 on top of 0493d57e0477

@dchard

dchard commented Mar 3, 2020

Copy link
Copy Markdown
Contributor

Here is the new build: c4f22de366e7 on top of 0493d57e0477

It produces a lot of segfault at boot.

Attached the complete bootlog.
860L_B1_log.txt

@dengqf6
dengqf6 force-pushed the ramips-5.4 branch 2 times, most recently from fee763b to 3ec54ab Compare March 3, 2020 17:38
@dengqf6

dengqf6 commented May 9, 2020

Copy link
Copy Markdown
Author

@outline941
Please post the full kernel stack trace.

@catsout

catsout commented May 9, 2020 •

Copy link
Copy Markdown

Please post the full kernel stack trace.

no sys/kernel/debug/crashlog found, even if I manually run 'echo c > /proc/sysrq-trigger'.
Is the only way to get log to use ttl?

@catsout

catsout commented May 10, 2020 •

Copy link
Copy Markdown

It seems that if igmpproxy has run once(even failed and exited), it will add some config to kernel. Then when I plug in the cable, kernel crashes. So I disable it in init.d, and no crash. But once I manually run it, kernel will crash.
I think it may have something to do with igmp snooping. So I disable it on br-lan, and then I run igmpproxy, it works.

@catsout

catsout commented May 10, 2020 •

Copy link
Copy Markdown

@dengqf6
Here is (igmpsnooping + igmproxy):

# /etc/init.d/igmpproxy start
[   82.284054] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 80591434
[   82.295627] Oops[#1]:
[   82.297965] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.4.38 #0
[   82.304180] Workqueue: events switchdev_deferred_process_work
^[[38;172R906] $ 0   : 00000000 00000001 ffffff86 8fe92080
[   82.315109] $ 4   : 8fe92080 00000006 00000001 00000001
[   82.320310] $ 8   : feff7273 00000018 80808080 fefefeff
[   82.325512] $12   : 000012b5 00000402 80708fe8 00000000
[   82.330713] $16   : 00000000 8fd3bdb4 8fe87800 80587da4
[   82.335915] $20   : 80588f24 ffffff86 00000100 808a0000
[   82.341117] $24   : 00000000 00000000                  
[   82.346318] $28   : 8fd3a000 8fd3bcb0 81005ae0 80591434
[   82.351537] Hi    : 000002ff
[   82.354410] Lo    : ef9db4cd
[   82.357282] epc   : 00000000 0x0
[   82.360515] ra    : 80591434 __switchdev_handle_port_attr_set+0x50/0x104
[   82.367182] Status: 11008403 KERNEL EXL IE 
[   82.371356] Cause : 50800008 (ExcCode 02)
[   82.375345] BadVA : 00000000
[   82.378213] PrId  : 0001992f (MIPS 1004Kc)
[   82.382285] Modules linked in: pppoe ppp_async iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack mt76x2e mt76x2_common mt76x02_lib mt7603e mt76 mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables crc_ccitt compat ledtrig_usbport ledtrig_heartbeat nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common
[   82.446902] Process kworker/0:1 (pid: 31, threadinfo=1014611c, task=dc0bfb6f, tls=00000000)
[   82.455212] Stack : 00000000 8fca4000 00000000 00000000 00001000 00000000 00000000 00000000
[   82.463545]         8fd3bdb4 8f0ec000 80587da4 80588f24 ffffff86 80591490 00000000 00000000
[   82.471877]         00000000 00000000 00000000 8eed3d0c ffffffff 00000000 ffffffff 00000000
[   82.480210]         00000008 8fd3bdb4 00000122 805914f8 ffffffff 810053c8 8eed6514 00000000
[   82.488541]         81005ae0 80588edc 00000000 00000000 00000000 800906f8 b3268dae 800497a4
[   82.496874]         ...
[   82.499312] Call Trace:
[   82.499316] 
[   82.503264] [<80587da4>] dsa_slave_dev_check+0x0/0x18
[   82.508298] [<80588f24>] dsa_slave_port_attr_set+0x0/0x68
[   82.513679] [<80591490>] __switchdev_handle_port_attr_set+0xac/0x104
[   82.520017] [<805914f8>] switchdev_handle_port_attr_set+0x10/0x28
[   82.526093] [<80588edc>] dsa_slave_switchdev_blocking_event+0x80/0xc8
[   82.532517] [<800906f8>] add_timer+0x60/0x140
[   82.536871] [<800497a4>] notifier_call_chain+0x6c/0xb0
[   82.541996] [<8004a0c0>] blocking_notifier_call_chain+0x64/0x8c
[   82.547911] [<803d4780>] netdev_trig_work+0xd4/0x108
[   82.552868] [<805916f4>] switchdev_port_attr_notify.constprop.12+0x34/0xac
[   82.559739] [<8006dcd0>] __update_load_avg_se+0x1dc/0x498
[   82.565129] [<805917d0>] switchdev_port_attr_set_now+0x64/0x9c
[   82.570960] [<800564f0>] set_next_entity+0x398/0x574
[   82.575921] [<80591828>] switchdev_port_attr_set_deferred+0x20/0x90
[   82.582172] [<8059159c>] switchdev_deferred_process+0x8c/0x18c
[   82.587989] [<8005f28c>] pick_next_task_fair+0x2d4/0x32c
[   82.593287] [<805916b4>] switchdev_deferred_process_work+0x18/0x24
[   82.599464] [<80041c88>] process_one_work+0x244/0x498
[   82.604501] [<80042044>] worker_thread+0x168/0x5ec
[   82.609277] [<80041edc>] worker_thread+0x0/0x5ec
[   82.613892] [<8004788c>] kthread+0x140/0x148
[   82.618156] [<80034178>] calculate_sigpending+0x40/0x68
[   82.623364] [<8004774c>] kthread+0x0/0x148
[   82.627449] [<8004774c>] kthread+0x0/0x148
[   82.631537] [<800068d8>] ret_from_kernel_thread+0x14/0x1c
[   82.636918] 
[   82.638399] Code: (Bad address in epc)
[   82.642139] 
[   82.644349] ---[ end trace c7bb30ce12ab36f9 ]---
[   82.648999] Kernel panic - not syncing: Fatal exception
[   82.654236] Rebooting in 3 seconds..

@dengqf6

dengqf6 commented May 10, 2020

Copy link
Copy Markdown
Author

@outline941
Were you proxying IGMP from br-mao to br-lan ?

@catsout

catsout commented May 10, 2020 •

Copy link
Copy Markdown

br-mao upstream
br-lan downstream
igmpsnooping enable on br-lan, disable on br-mao
test with cable in

@dengqf6

dengqf6 commented May 10, 2020

Copy link
Copy Markdown
Author

@outline941
Firstly, try it without modifying PVID or VLAN filtering, it's unnecessary in your setup.

If the kernel still panics, try #2942

@lipnitsk

Copy link
Copy Markdown
Contributor

@981213

By switching to DSA we'll give up all hw offloads on ethernet including HWNAT. Switch adds a special tag to ethernet packet and this non-standard packet can't be handled by hardware because ethernet mac and HWNAT engine don't understand packet content of received packets and also can't create and send such packets.

So is 4.14 kernel/19.07 branch the last release to ever support HWNAT (however broken it is now) for mt7530/mt7621? Or is there some hope of HWNAT support going forward? Does your comment below imply HWNAT support or SW offload support?

@blogic mentioned once on IRC that he already has a 5.4 support for ramips lying around.

@gwlim

gwlim commented May 11, 2020

Copy link
Copy Markdown
Contributor

Anyone faced this issue before? Just by leaving LuCI open the router becomes unresponsive.

Mon May 11 01:00:24 2020 kern.err kernel: [ 5772.439195] rcu: INFO: rcu_sched self-detected stall on CPU
Mon May 11 01:00:24 2020 kern.err kernel: [ 5772.444782] rcu:   0-....: (14999 ticks this GP) idle=64e/1/0x40000002 softirq=403269/403269 fqs=7500
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.453953]       (t=15000 jiffies g=677233 q=174)
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.458286] NMI backtrace for cpu 0
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.461760] CPU: 0 PID: 1565 Comm: dropbear Not tainted 5.4.39 #0
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.467820] Stack : 806c0000 80076f98 80680000 8067b6a4 806e0000 8067b66c 8067a7c0 8fc0dd3c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.476139]         80820000 8feb8ee4 806c4d43 806108f4 00000000 00000001 8fc0dce0 c49fa9f6
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.484454]         00000000 00000000 80840000 00000000 30232039 00000150 35206465 332e342e
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.492770]         00000000 0000011f 00000000 00070bc0 80000000 806e0000 00000000 00000000
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.501086]         80604d8c 806c22b0 806c0000 00000000 00000000 8032456c 00000000 80820000
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.509401]         ...
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.511833] Call Trace:
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.514289] [<8000b67c>] show_stack+0x30/0x100
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.518732] [<8055883c>] dump_stack+0xa4/0xdc
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.523072] [<8055eee0>] nmi_cpu_backtrace+0xe4/0x134
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.528098] [<8055f064>] nmi_trigger_cpumask_backtrace+0x134/0x19c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.534258] [<80086c28>] rcu_dump_cpu_stacks+0xe0/0x12c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.539462] [<8008b8b0>] rcu_sched_clock_irq+0x6e8/0x950
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.544752] [<80090dc4>] update_process_times+0x2c/0x78
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.549961] [<800a2ee0>] tick_handle_periodic+0x34/0xd0
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.555183] [<803b744c>] gic_compare_interrupt+0x7c/0x9c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.560488] [<8007e240>] handle_percpu_devid_irq+0xbc/0x19c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.566033] [<800781c8>] generic_handle_irq+0x40/0x58
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.571065] [<802c68c4>] gic_handle_local_int+0x98/0x120
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.576350] [<802c6b10>] gic_irq_dispatch+0x10/0x20
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.581202] [<800781c8>] generic_handle_irq+0x40/0x58
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.586244] [<80579284>] do_IRQ+0x1c/0x2c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.590233] [<802c636c>] plat_irq_dispatch+0x64/0x104
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.595260] [<80006d48>] except_vec_vi_end+0xb8/0xc4
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.600218] [<8052f258>] br_get_stats64+0xf4/0x210
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.605005] [<803e4560>] dev_get_stats+0x48/0xfc
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.609606] [<80422ea0>] dev_seq_printf_stats+0x24/0x1f4
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.614892] [<80423088>] dev_seq_show+0x18/0x44
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.619420] [<8019800c>] seq_read+0x34c/0x5a4
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.623762] [<801d5648>] proc_reg_read+0x74/0xbc
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.628372] [<8016a270>] __vfs_read+0x28/0x1fc
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.632793] [<8016a4e4>] vfs_read+0xa0/0x154
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.637041] [<8016a820>] ksys_read+0x64/0x10c
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.641384] [<80014578>] syscall_common+0x34/0x58

@jonathan-sturges

Copy link
Copy Markdown
Contributor

Anyone faced this issue before? Just by leaving LuCI open the router becomes unresponsive.

Mon May 11 01:00:24 2020 kern.err kernel: [ 5772.439195] rcu: INFO: rcu_sched self-detected stall on CPU
Mon May 11 01:00:24 2020 kern.err kernel: [ 5772.444782] rcu:   0-....: (14999 ticks this GP) idle=64e/1/0x40000002 softirq=403269/403269 fqs=7500
Mon May 11 01:00:24 2020 kern.warn kernel: [ 5772.453953]       (t=15000 jiffies g=677233 q=174)
...

I do see those with kernel 5.4.39. I'm only testing builds for a new MT7621 device and I can see those on the console periodically even though the unit is idle.

@dengqf6

dengqf6 commented May 14, 2020

Copy link
Copy Markdown
Author

@pmelange I've pushed a patch to fix untagged frames pass through the CPU port when VLAN filtering is enabled. #2942

@kristrev

Copy link
Copy Markdown
Contributor

When going through my spam folder, I suddenly saw all the notifications from the issue. Sorry about not getting involved earlier.

Disabling flow control has not made the TX Timeout-issue go completely away for me, but the issue occurs much more rarely. Combined with a small watchdog that restarts networking when the timeout error does happen, networking works without any problems on my devices. I do not know if it is relevant, but my test case for TX timeout was to spam an mt7621-device with pause frames. The error occur would occur very quickly after the packet spam started and in several cases the switch was never able to recover.

I have also seen the RCU stall issue on 4.14. However, it happens very rarely.

@Borromini

Borromini commented May 14, 2020 •

Copy link
Copy Markdown
Contributor

@dengqf6 On my DIR-860L B1 the 2,4 GHz radio disappeared with the 5.4 bump. Looks like something with the new PCIe driver. I filed a bug on FlySpray.

@pmelange

Copy link
Copy Markdown
Contributor

@pmelange I've pushed a patch to fix untagged frames pass through the CPU port when VLAN filtering is enabled. #2942

I'm building a freifunk firmware based off of your branch. I'll let you know how it goes. Thanks for the update.

@pmelange

Copy link
Copy Markdown
Contributor

@pmelange I've pushed a patch to fix untagged frames pass through the CPU port when VLAN filtering is enabled. #2942

I'm building a freifunk firmware based off of your branch. I'll let you know how it goes. Thanks for the update.

The results of using #2942 are in the comments there. But a quick spoiler, it's working... so far :)

@vDorst @dengqf6 thanks for all the work.

@Vladdrako

Vladdrako commented May 20, 2020 •

Copy link
Copy Markdown
Contributor

My C-Media USB sound card and UPS Powercom BNT-800AP are not working via Genesys Logic GL3523 USB 3.0 hub. I see them but can't play audio through sound card and USP constantly reconnecting. In dmesg:
[ 43.070021] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.076569] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.082085] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.082108] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.089730] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.095241] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.095262] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.103196] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.108716] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.108734] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.119244] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.124751] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.124768] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.131379] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.136895] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.136913] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.143548] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.149062] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.149079] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.156743] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.162215] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.162233] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.170216] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.175723] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.175742] usb 1-1.2: 2:1: usb_set_interface failed (-28) [ 43.309010] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.314513] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.314530] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 43.320561] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.326125] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.326154] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 43.332146] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.337702] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.337719] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 43.343783] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.349260] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.349278] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 43.355435] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 43.360959] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 43.360979] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 87.108604] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 87.114034] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 87.114043] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 97.702317] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 97.707794] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 97.707808] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 118.831901] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 118.837331] usb 1-1.2: Not enough bandwidth for altsetting 1 [ 118.837340] usb 1-1.2: 1:1: usb_set_interface failed (-28) [ 172.390573] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-mtk [ 172.415553] hub 2-1:1.0: USB hub found [ 172.416002] hub 2-1:1.0: 4 ports detected [ 179.401451] usb 1-1.2: USB disconnect, device number 4 [ 181.414366] usb 1-1.2: new full-speed USB device number 6 using xhci-mtk [ 181.522079] xhci-mtk 1e1c0000.xhci: Not enough bandwidth! [ 181.527538] usb 1-1.2: Not enough bandwidth for altsetting 1
And this bug is still present.

@lantsem

lantsem commented May 25, 2020

Copy link
Copy Markdown

Received TX timed out error during testing QoS throughput with my 200 Mbps uplink connected to RT-AC65P:

[2129335.921693] ------------[ cut here ]------------
[2129335.931302] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:448 dev_watchdog+0x2fc/0x304
[2129335.948124] NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
[2129335.962350] Modules linked in: mt7615e mt7615_common mt76 mac80211 iptable_nat ipt_REJECT cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_MASQUERADE xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY nf_reject_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack_ftp nf_conncount iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables compat act_connmark nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common
[2129336.134923] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G        W         5.4.36 #0
[2129336.149808] Stack : ffffffff 800772d8 80670000 806704ac 806d0000 80670474 8066f5c8 8fc11db4
[2129336.166780]         80810000 8fc3c724 806b6d03 80608584 00000002 00000001 8fc11d58 39a2f9a5
[2129336.183744]         00000000 00000000 80850000 00000000 20202020 000004e5 332e342e 30232036
[2129336.200704]         00000000 00019dd7 00000000 00020f0b 00000000 806d0000 00000000 804367f4
[2129336.217670]         00000009 00000002 00200000 00000122 00000000 80324938 00000008 80810008
[2129336.234638]         ...
[2129336.239838] Call Trace:
[2129336.245072] [<8000b72c>] show_stack+0x30/0x100
[2129336.254267] [<80551674>] dump_stack+0xa4/0xdc
[2129336.263286] [<80028058>] __warn+0xc0/0x10c
[2129336.271774] [<80028130>] warn_slowpath_fmt+0x8c/0xac
[2129336.282002] [<804367f4>] dev_watchdog+0x2fc/0x304
[2129336.291703] [<80090180>] call_timer_fn.isra.34+0x20/0x90
[2129336.302617] [<800903c8>] run_timer_softirq+0x1d8/0x230
[2129336.313194] [<805721a4>] __do_softirq+0x16c/0x334
[2129336.322902] [<8002c7a4>] irq_exit+0x98/0xb0
[2129336.331564] [<802c6680>] plat_irq_dispatch+0x64/0x104
[2129336.341956] [<80006de8>] except_vec_vi_end+0xb8/0xc4
[2129336.352169] [<80571858>] r4k_wait_irqoff+0x1c/0x24
[2129336.362262] ---[ end trace 4467cbb6c3dc6584 ]---
[2129336.371811] mtk_soc_eth 1e100000.ethernet eth0: transmit timed out
[2129336.385878] mtk_soc_eth 1e100000.ethernet eth0: Link is Down
[2129336.424952] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[2129336.441019] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

@lantsem

lantsem commented May 30, 2020 •

Copy link
Copy Markdown

Since upgrade to 5.4 kernel I often see 'SQUASHFS error: xz decompression failed, data probably corrupt' after sysupgrade with RT-AC65P:

[   15.132705] Loading modules backported from Linux version v5.7-rc3-0-g6a8b55ed4056
[   15.147819] Backport generated by backports.git v5.7-rc3-1-0-gc0c7d2bb
[   15.199945] urngd: v1.0.2 started.
[   15.207371] xt_time: kernel timezone is -0000
[   15.286689] mt7621-pci 1e140000.pcie: bus=1 slot=0 irq=24
[   15.297532] pci 0000:00:00.0: enabling device (0006 -> 0007)
[   15.308872] mt7615e 0000:01:00.0: enabling device (0000 -> 0002)
[   15.334338] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   15.338294] mt7621-pci 1e140000.pcie: bus=2 slot=1 irq=25
[   15.349122] pci 0000:00:01.0: enabling device (0006 -> 0007)
[   15.351923] random: crng init done
[   15.352133] mt7615e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20180518100604a
[   15.352133] 
[   15.360455] mt7615e 0000:02:00.0: enabling device (0000 -> 0002)
[   15.381802] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   15.407560] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.422420] mt7615e 0000:02:00.0: HW/SW Version: 0x8a108a10, Build Time: 20180518100604a
[   15.422420] 
[   15.640940] SQUASHFS error: xz decompression failed, data probably corrupt
[   15.654722] SQUASHFS error: squashfs_read_data failed to read block 0x7c12e
[   15.722546] SQUASHFS error: xz decompression failed, data probably corrupt
[   15.736283] SQUASHFS error: squashfs_read_data failed to read block 0x7c12e
[   15.822554] SQUASHFS error: xz decompression failed, data probably corrupt
[   15.836293] SQUASHFS error: squashfs_read_data failed to read block 0x7c12e
[   15.850470] mt7615e 0000:01:00.0: loading /lib/firmware/mediatek/mt7615_n9.bin failed with error -5
[   15.868555] mt7615e 0000:01:00.0: Direct firmware load for mediatek/mt7615_n9.bin failed with error -5
[   15.887162] mt7615e 0000:01:00.0: Falling back to sysfs fallback for: mediatek/mt7615_n9.bin
[   16.485064] SQUASHFS error: xz decompression failed, data probably corrupt
[   16.498806] SQUASHFS error: squashfs_read_data failed to read block 0x7c12e
[   16.513059] mt7615e 0000:02:00.0: N9 Firmware Version: <B2>^K<93><F1><D8><E2><F2><CD>f<F9>, Build Time: <F6>j<C2>)ߞV<E1>^QK&Ϛ<C8><DC>
[   16.513336] mt7615e 0000:01:00.0: N9 Firmware Version: <B2>^K<93><F1><D8><E2><F2><CD>f<F9>, Build Time: <F6>j<C2>)ߞV<E1>^QK&Ϛ<C8><DC>
[   16.565240] mt7615e 0000:02:00.0: Failed to send firmware to device
[   16.612603] mt7615e 0000:01:00.0: Failed to send firmware to device

It can happen after sysupgrade or after flashing from stock firmware. Never seen it with 4.14 kernel. Has anyone seen this issue before?

@lantsem

lantsem commented Jun 1, 2020 •

Copy link
Copy Markdown

Built fresh OpenWrt master r13419-8d2c031f21 with disabled FC on CPU port and turned off FC on laptop port. Run some speedtest on my 1Gbps uplink (transfer speed was ~450-500 Mbps with RPS use) and still got TX timed out error:

[  148.159200] ------------[ cut here ]------------
[  148.168452] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:448 dev_watchdog+0x2fc/0x304
[  148.184920] NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
[  148.198774] Modules linked in: mt7615e mt7615_common mt76 mac80211 iptable_nat ipt_REJECT cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_MASQUERADE xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY nf_reject_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack_ftp nf_conncount iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables compat act_connmark nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common
[  148.370914] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.4.42 #0
[  148.382686] Stack : ffffffff 80077050 80670000 806736b4 806d0000 8067367c 806727d0 8fc0fdb4
[  148.399305]         80810000 8fc3c184 806bad03 8060aa20 00000001 00000001 8fc0fd58 032b474f
[  148.415923]         00000000 00000000 80850000 00000000 00000030 0000015a 342e3520 2032342e
[  148.432546]         00000000 00000007 00000000 0005a8e2 00000000 806d0000 00000000 80437f74
[  148.449169]         00000009 00000001 00200000 00000122 00000002 80324ba4 00000004 80810004
[  148.465794]         ...
[  148.470653] Call Trace:
[  148.475536] [<8000b72c>] show_stack+0x30/0x100
[  148.484389] [<80552ee8>] dump_stack+0xa4/0xdc
[  148.493059] [<80028058>] __warn+0xc0/0x10c
[  148.501201] [<80028130>] warn_slowpath_fmt+0x8c/0xac
[  148.511087] [<80437f74>] dev_watchdog+0x2fc/0x304
[  148.520447] [<80090210>] call_timer_fn.isra.34+0x20/0x90
[  148.531012] [<80090458>] run_timer_softirq+0x1d8/0x230
[  148.541242] [<80573a0c>] __do_softirq+0x16c/0x334
[  148.550603] [<8002c7a4>] irq_exit+0x98/0xb0
[  148.558925] [<802c6838>] plat_irq_dispatch+0x64/0x104
[  148.568974] [<80006de8>] except_vec_vi_end+0xb8/0xc4
[  148.578847] [<805730c0>] r4k_wait_irqoff+0x1c/0x24
[  148.588547] ---[ end trace ed0af6ad2fe5a0f4 ]---
[  148.597743] mtk_soc_eth 1e100000.ethernet eth0: transmit timed out
[  148.611912] mtk_soc_eth 1e100000.ethernet eth0: Link is Down
[  148.650450] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[  148.666702] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

Any thoughts?

Edit: my ISP switch has FC disabled:

[   26.055816] mt7530 mdio-bus:1f wan: Link is Up - 1Gbps/Full - flow control off

@eduardo010174

eduardo010174 commented Jun 4, 2020 •

Copy link
Copy Markdown
Contributor

new commits added
#2942

@adschm

adschm commented Jun 24, 2020

Copy link
Copy Markdown
Member

How is the state of the other subtargets for ramips (mt7620, rt288x, rt305x, rt3883) still on kernel 4.14?
Are they expected to work with kernel 5.4? Has anybody tested with the testing kernel already?

@gwlim

gwlim commented Jun 27, 2020 •

Copy link
Copy Markdown
Contributor

MT7621 still have issues

root@openwrt:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
  8:   18069990   18070084   18070090   18070079  MIPS GIC Local   1  timer
  9:     234669          0          0          0  MIPS GIC  63  IPI call
 10:          0   16346127          0          0  MIPS GIC  64  IPI call
 11:          0          0    1168215          0  MIPS GIC  65  IPI call
 12:          0          0          0     892251  MIPS GIC  66  IPI call
 13:     712504          0          0          0  MIPS GIC  67  IPI resched
 14:          0     841799          0          0  MIPS GIC  68  IPI resched
 15:          0          0    1071964          0  MIPS GIC  69  IPI resched
 16:          0          0          0    1070099  MIPS GIC  70  IPI resched
 17:          0          0          0          0  MIPS GIC  19  1e000600.gpio-bank0, 1e000600.gpio-bank1, 1e000600.gpio-bank2
 19:         12          0          0          0  MIPS GIC  33  ttyS0
 20:          0          0          0          0  MIPS GIC  29  xhci-hcd:usb1
 21:   24135751          0          0          0  MIPS GIC  10  1e100000.ethernet
 23:         73          0    2992770          0  MIPS GIC  11  mt76x2e
 24:         73          0          0    6926729  MIPS GIC  31  mt7603e
 27:          0          0          0          0  1e000600.gpio   3  keys
 28:          0          0          0          0  1e000600.gpio   7  keys
ERR:       4704

@dchard

dchard commented Jun 29, 2020

Copy link
Copy Markdown
Contributor

@gwlim the fact you see some errors in /proc/interrupts does not mean anything. On our X86 server, we also see some. Is there anything concrete you experience with mt7621?

@gwlim

gwlim commented Jun 29, 2020 •

Copy link
Copy Markdown
Contributor

@gwlim the fact you see some errors in /proc/interrupts does not mean anything. On our X86 server, we also see some. Is there anything concrete you experience with mt7621?

I am still getting
rcu: INFO: rcu_sched self-detected stall on CPU on kernel 5.4 with dumps on user mode applications
Effects the router will hang totally for a few minutes and maybe recover
Can't really debug on what is causing it
I don't think mt7621 is stable on kernel 5.4 with such errors occurring.

@MeIsReallyBa

MeIsReallyBa commented Jul 3, 2020 •

Copy link
Copy Markdown

Built fresh OpenWrt master r13419-8d2c031f21 with disabled FC on CPU port and turned off FC on laptop port. Run some speedtest on my 1Gbps uplink (transfer speed was ~450-500 Mbps with RPS use) and still got TX timed out error:

[  148.159200] ------------[ cut here ]------------
[  148.168452] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:448 dev_watchdog+0x2fc/0x304
[  148.184920] NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
[  148.198774] Modules linked in: mt7615e mt7615_common mt76 mac80211 iptable_nat ipt_REJECT cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_MASQUERADE xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY nf_reject_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack_ftp nf_conncount iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables compat act_connmark nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common
[  148.370914] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.4.42 #0
[  148.382686] Stack : ffffffff 80077050 80670000 806736b4 806d0000 8067367c 806727d0 8fc0fdb4
[  148.399305]         80810000 8fc3c184 806bad03 8060aa20 00000001 00000001 8fc0fd58 032b474f
[  148.415923]         00000000 00000000 80850000 00000000 00000030 0000015a 342e3520 2032342e
[  148.432546]         00000000 00000007 00000000 0005a8e2 00000000 806d0000 00000000 80437f74
[  148.449169]         00000009 00000001 00200000 00000122 00000002 80324ba4 00000004 80810004
[  148.465794]         ...
[  148.470653] Call Trace:
[  148.475536] [<8000b72c>] show_stack+0x30/0x100
[  148.484389] [<80552ee8>] dump_stack+0xa4/0xdc
[  148.493059] [<80028058>] __warn+0xc0/0x10c
[  148.501201] [<80028130>] warn_slowpath_fmt+0x8c/0xac
[  148.511087] [<80437f74>] dev_watchdog+0x2fc/0x304
[  148.520447] [<80090210>] call_timer_fn.isra.34+0x20/0x90
[  148.531012] [<80090458>] run_timer_softirq+0x1d8/0x230
[  148.541242] [<80573a0c>] __do_softirq+0x16c/0x334
[  148.550603] [<8002c7a4>] irq_exit+0x98/0xb0
[  148.558925] [<802c6838>] plat_irq_dispatch+0x64/0x104
[  148.568974] [<80006de8>] except_vec_vi_end+0xb8/0xc4
[  148.578847] [<805730c0>] r4k_wait_irqoff+0x1c/0x24
[  148.588547] ---[ end trace ed0af6ad2fe5a0f4 ]---
[  148.597743] mtk_soc_eth 1e100000.ethernet eth0: transmit timed out
[  148.611912] mtk_soc_eth 1e100000.ethernet eth0: Link is Down
[  148.650450] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[  148.666702] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

Any thoughts?

Edit: my ISP switch has FC disabled:

[   26.055816] mt7530 mdio-bus:1f wan: Link is Up - 1Gbps/Full - flow control off

I used these rules and Qualcomm SFE fast path. Iperf3 speed reached about 940Mb/s and 5G 800Mb/s(7615 ProprietaryDriver 160MHZ)
echo "4" > "/sys/class/net/eth0/queues/rx-0/rps_cpus"
echo "4" > "/proc/irq/21/smp_affinity"
echo "8" > "/proc/irq/23/smp_affinity"
echo "8" > "/proc/irq/24/smp_affinity"
echo "2" > "/sys/class/net/wan/queues/rx-0/rps_cpus"
echo "2" > "/sys/class/net/pppoe-wan/queues/rx-0/rps_cpus"
echo "2" > "/sys/class/net/lan1/queues/rx-0/rps_cpus"
echo "2" > "/sys/class/net/lan2/queues/rx-0/rps_cpus"
echo "2" > "/sys/class/net/lan3/queues/rx-0/rps_cpus"
echo "2" > "/sys/class/net/lan4/queues/rx-0/rps_cpus"

@gwlim

gwlim commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

The hang issues no longer occurs on r13768-f632747704.
I suspect it has to do with dsp issue which is recently fixed.

@xyyx

xyyx commented Aug 6, 2020 •

Copy link
Copy Markdown

The hang issues no longer occurs on r13768-f632747704.
I suspect it has to do with dsp issue which is recently fixed.

I can't confirm. I have troubles on latest snapshot(
2020.08.05-23:12:42 <192.168.1.1>: <6>Aug 5 23:12:39 OpenWrt kernel: [ 6998.391626] mt7530 mdio-bus:1f wan: configuring for phy/gmii link mode
2020.08.05-23:12:42 <192.168.1.1>: <6>Aug 5 23:12:39 OpenWrt kernel: [ 6998.405103] 8021q: adding VLAN 0 to HW filter on device wan
2020.08.05-23:12:42 <192.168.1.1>: <29>Aug 5 23:12:39 OpenWrt netifd: Interface 'wan' is enabled
2020.08.05-23:12:42 <192.168.1.1>: <3>Aug 5 23:12:40 OpenWrt kernel: [ 6999.118439] mtk_soc_eth 1e100000.ethernet eth0: transmit timed out
2020.08.05-23:12:42 <192.168.1.1>: <6>Aug 5 23:12:40 OpenWrt kernel: [ 6999.131121] mtk_soc_eth 1e100000.ethernet eth0: Link is Down
2020.08.05-23:12:42 <192.168.1.1>: <6>Aug 5 23:12:40 OpenWrt kernel: [ 6999.169667] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
2020.08.05-23:12:42 <192.168.1.1>: <6>Aug 5 23:12:40 OpenWrt kernel: [ 6999.185324] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
2020.08.05-23:12:42 <192.168.1.1>: <27>Aug 5 23:12:40 OpenWrt xl2tpd[2240]: udp_xmit failed to 37.203.34.15:1701 with err=-1:Network unreachable
2020.08.05-23:12:42 <192.168.1.1>: <27>Aug 5 23:12:40 OpenWrt xl2tpd[2240]: udp_xmit failed to 194.1.241.127:1701 with err=-1:Network unreachable
Random( But I don't have trouble on OpenWrt SNAPSHOT r13110-a3079fb7ba

@gwlim

gwlim commented Aug 7, 2020 •

Copy link
Copy Markdown
Contributor

Okay yes it still happens.

Is there a patch to disable flow control on all ports for mt7621?
Why it is only disabled on certain ports but not others?

@xyyx

xyyx commented Aug 7, 2020

Copy link
Copy Markdown

Okay yes it still happens.

Is there a patch to disable flow control on all ports for mt7621?
Why it is only disabled on certain ports but not others?

All ports without FC. I disabled it on clients. But wan was disabled by default. I tried to see diffs between snapshots and found many commits. And I don't know why r13110-a3079fb7ba works without any issues except bad offloading. I don't have 1gbit on wan. Just 450-500mbits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes RFC pull request ready for comments RFT pull request ready for testing target/ramips pull request/issue for ramips target

Projects

None yet

Development

Successfully merging this pull request may close these issues.