ophub/amlogic-s9xxx-armbian

适用于 s905x3 的 Armbian 和 OpenWRT镜像(内核 6.1.x) 无线不正常

ihexon opened this issue · 23 comments

设备信息

  • SOC: S095x3
  • Model: HK1BOX(S905X3),Tanix Tx3(S905X3)

系统版本

  • Kernel Version: 6.1.x
  • Release: jammy
  • DTB Tree: meson-sm1-hk1box-vontar-x3.dtb

问题描述
这个问题在 6.1.x 内核的所有适用于 s905x3 soc 的固件中出现(Armbian/Openwrt),在 WIFI 吞吐量大的时候 WIFI 将崩溃,且系统有几率出现冻结,盒子串口打印 Kernel Panic 信息。

可能和 brcm 的 firmware 有关。位置 brcm/brcmfmac4339-sdio
将内核降级到 5.18.x 可临时解决这个问题。

目测是 6.1.x 内核或者 wireless firmware 造成的
这个问题似乎是上游 kernel 6.1.x 造成的。
我编译了主线内核 amlogic/linux.git,与 unifreq/linux-6.1.y 均出现相同问题。

我所使用的内核配置配置文件参考自 config-6.1.1-flippy

我所使用的 firmware 来源于 ophub/firmware,以及提取自镜像 Armbian_23.02.0_amlogic_s905x3_jammy_6.1.3_server_2023.01.05.img.gz 内的 firmware

复现过程

  1. 启动任意 6.1.x 内核的适用于 s905x3 芯片组的镜像,并初始化设置。
  2. 断开盒子的有线网络,使用 nmtui 连接任意 WIFI(5G/2.4G)。
  3. 登录s905x3 盒子,使用 iperf3 -c [iperf3-server-ip] 对 WIFI 进行测试。
  4. ssh 会话冻结,WIFI 崩溃,触发系统冻结。

与你的情况近似。
我的发生在,内核6.1.y 6.0.y 5.15.y,其中5.15.y早期更新的子版本中没有问题,近期更新的子版本有这个问题。

出现问题的盒子
ugoos x3 soc s905x3 无线网卡 ap6255(bcm43455)
极光盒子3pro soc s905x3 无线网卡 mt7661rsn(mt7663s)

复现过程
通过无线连接复制文件到盒子(文件大小500MB),复制过程中,或复制完成。system load 开始持续增长至100+,并继续增长,直至无线连接中断。ssh无法通过无线连接盒子。此时可以ping通盒子,随时间推移至ping超时。

在禁用无线网卡驱动重启后,此问题消失。启用无线网卡驱动重启后,问题重现。

#876

ophub commented

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

这是官方最新的,我仓库里的是几年前的,因为n1用户没有不能用的反馈,我就没更新。你下载官方的最新的替换一下,也许这个配6.1这些新内核比较适合。

Hi Ophub,

I wonder this is the same/similar issue I am facing in 6.1.y on GT King Pro (Rev A): #861.

I have tested your kernel-6.1.y with newer linux-firmware/kinetic-updates,now 20220923.gitf09bebf3-0ubuntu1.1 all [installed], and still have the WIFI issue, WIFI is initially available on Boot Up but after a few minutes it will disappear/loss.

ophub commented

As we have reported, several recent kernels have experienced wireless instability, which may be caused by a wireless patch.

Hi @ophub,

A quick feedback.

Kernel-6.1.5-happy-new-year still have the WIFI issue and system stability after the WIFI/Network is loss. Shutdown or reboot will just stuck at "Stop job..." It will not shutdown or reboot.

与你的情况近似。 我的发生在,内核6.1.y 6.0.y 5.15.y,其中5.15.y早期更新的子版本中没有问题,近期更新的子版本有这个问题。

出现问题的盒子 ugoos x3 soc s905x3 无线网卡 ap6255(bcm43455) 极光盒子3pro soc s905x3 无线网卡 mt7661rsn(mt7663s)

复现过程 通过无线连接复制文件到盒子(文件大小500MB),复制过程中,或复制完成。system load 开始持续增长至100+,并继续增长,直至无线连接中断。ssh无法通过无线连接盒子。此时可以ping通盒子,随时间推移至ping超时。

在禁用无线网卡驱动重启后,此问题消失。启用无线网卡驱动重启后,问题重现。

#876

很奇怪的问题,我以为该问题只在出现在带有 BCM 无线模块 WiFi 的主板上,你提供的信息非常有用,说明这个问题也在 BCM 以外的 WiFi 模块中存在,或许问题不在 BCM 的 Firmware 中。

我近期在家中调试此问题,到目前为止我还无法定位到具体发生问题的代码上下文,据我推测可能与某次有关 mac80211 的补丁有关。

由于我手中只有HK1BOX(S905X3),Tanix Tx3(S905X3),这两者使用相近的硬件,都为BCM WiFi 模块,我缺乏更多的信息帮助我调试这个问题。

你能提供更多的有关这个问题的信息吗?包括dmesg信息,system load,日志等,你尝试的内核版本,最后一次提交的commit id等,冗长的日志可以通过 gz 压缩后上传到这里。

感谢。

Hi Ophub,

I wonder this is the same/similar issue I am facing in 6.1.y on GT King Pro (Rev A): #861.

I have tested your kernel-6.1.y with newer linux-firmware/kinetic-updates,now 20220923.gitf09bebf3-0ubuntu1.1 all [installed], and still have the WIFI issue, WIFI is initially available on Boot Up but after a few minutes it will disappear/loss.

Exactly the same behavior on Phicomm-N1 with Jammy-6.1.4

ophub commented

armbian-config里面有一个安装完整firmware的选项,你可以试一下上游最新的firmware。我使用的是几年前的了,也许是和6.x.y不太兼容。

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

或者从这下载覆盖测试一下。

armbian-config里面有一个安装完整firmware的选项,你可以试一下上游最新的firmware。我使用的是几年前的了,也许是和6.x.y不太兼容。

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

或者从这下载覆盖测试一下。

在问题出现的初期我已经尝试此办法,使用上游 firmware 覆盖 IMG 内的 /lib/firmware/*,问题依旧存在。根据这个回复所描述的情况

出现问题的盒子 ugoos x3 soc s905x3 无线网卡 ap6255(bcm43455) 极光盒子3pro soc s905x3 无线网卡 mt7661rsn(mt7663s)

可能并非与特定WiFi模块的Firmware有关。

Hi @ophub,

I installed your kernel-6.1.y on Ubuntu-Kinetic image (device GT King Pro rev A) where it uses the latest Ubuntu Kinetic linux-firmware it still have the WIFI problem.

Tested kernel-6.1.6-flippy-81+ just a while ago and it still have the WIFI problem.

The only kernel-6.1.y that do NOT have this WIFI issue is the latest Manjaro-Arm linux-6.1.6-1: https://gitlab.manjaro.org/manjaro-arm/packages/core/linux/-/jobs/11407/artifacts/browse

Previous Manjaro-Arm-linux-6.1.2-1 and linux-6.1.4-3 both have the same WIFI problem.

@ruleechen @ihexon @JFLim1 上游已经修复此问题。

@ophub o大 重新编译最新f大6.1.y内核即可解决问题。

这是我临时编译的内核,经测试问题已经解决 6.1.4-wifi.tar.gz

ophub commented

好消息,现在6.0是EOL了,这6.1大概率是LTS了,希望这个系列更加稳定一些。

内核5.15真的很稳并且网络传输效率,在我的环境中测试最好。希望下一个LTS可以全面赶超5.15。

经过测试本地测试,设备 Tanix Tx3(S905X3),证明
unifreq/linux-6.1.y 源码仓库已修复此问题,iperf3 测得 无线速率40 Mbits/sec 且较为稳定。感谢开源社区提供的支持~,给大家拜个早年 :)

PS:我非常好奇这个BUG是从哪个提交引入,又是哪个提交被修复的。

ophub commented

unifreq/linux-6.1.y@fb3d39f

点这个补丁说明里面的链接看

@ihexon 补丁本意是好的,增加sdio中断支持,在S905X4 sdio bcm4334 wifi测试成功,但这段代码对我们这部分sdio wifi 存在异常问题。估计后续修复后还会增加回来。同时还增加了另一个IRQ_EN_MASK补丁。

另外5.15.y内核网络传输能力,确实优于现在的6.1.y,简单的分析了一下,能力有限没有找问题点。😂

@ophub o大 抽空帮忙分析一下 wifi问题修复后,有这样的提示
meson-gx-mmc ffe03000.sd: unaligned sg offset 2051, disabling descriptor DMA for transfer
上面的2051不是固定的数字,每次重启都不一样。这个DMA对无线传输有什么影响吗? 百度了一圈没查到啥。
google查到一知半解,说什么64或128的什么参数有关,看不懂。😵
在修复wifi之前这样提示 unaligned sg len 数字 blksize 数字, disabling descriptor DMA for transfer

ophub commented

这个问题咨询了下f大,说没影响。

ok,没有影响就不理他了。感谢o大

这个问题是不是又出现了?
最近的几个 6.1 版本的内核刷完又有几率无网。
现在 5.15 运行一天了没问题。

JFLim1 commented

Hi @wordlesswind,

On Beelink GT King Pro Rev A (S922X) kernels 6.1.29-flippy-83+ and 6.1.29-ophub so far don't seem to have WIFI/Network connection issue.

On Beelink GT King Pro Rev A (S922X) kernels 6.1.29-flippy-83+ and 6.1.29-ophub so far don't seem to have WIFI/Network connection issue.

This is good news, but mine is a Phicomm N1. I don't dare to try it again easily, so I'll just keep it as it is.

Well, I couldn't resist trying to reinstall armbian and OMV.

So I got the error: sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_helper: No such file or directory

Well, I eventually found out that it wasn't a problem on the network, but my hard drive that was causing it.

I plugged in an SSD with a JMicron JMS580B hard drive enclosure solution, from an older computer.

I don't know why, it would cause the system to crash after a long access time and not be able to connect to the device via SSH, so I wasn't able to troubleshoot the problem.

Stranger still, HDD with the JMS576 solution will simply fail to mount.

As far as I can tell, both work fine on Windows, so I can't say for sure if the drive is corrupted.

I tend to think that JMicron's products have poor compatibility with Linux, so be sure to pay attention to that when you're shopping for a hard drive enclosure.

Here is other example: https://forums.linuxmint.com/viewtopic.php?t=317542