Kernel 6.1.0 breaks WiFi

Which Khadas SBC do you use?

Vim3 Pro

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu 22.04 LTS

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official image, installed with OOWOW

Please describe your issue below:

WiFi support on the VIM3 has always been poor. As soon as some larger download is going on, the Kernel load spikes to 4 or even higher and latency of any other traffic (ping, ssh) becomes painfully slooow. But at least, it was working until Linux Kernel 6.0.0.

Now with Kernel 6.1.0, when there is a larger download, the device becomes effectively offline - it doesn’t even respond to a ping anymore. Unfortunately, it also doesn’t seem to recover. However, the device is not crashed - I can still login to the console.

Is this a known problem or am I the first to report it? I couldn’t find related posts in this forum.

1 Like

Yes there is an regression in upstream kernel aince 6.1

We have reverted the patch which causes this issue.

Here is the patch which we use.

It fixes the sdio dying after few mins of use.

Khadas team will have to add this patch.

Currently the team is on holiday so they should do it after the holidays.

Good luck.

1 Like

Does this also affect the VIM4 or even the Edge2? I’m going to start evaluating these board this week.

Only Amlogic devices which use mainline kernel.
Vim4 and Edge2 is not affected as that dont use Mainline kernel.
Only vim 1 - 3/3l I guess

VIM4 is an Amlogic A311D2, so my educated guess would be yes?! Or are you saying VIM4 doesn’t have mainline Kernel, so it’s not affected?

Yes, since those devices are not on the mainline kernel, they won’t be affected by the issue.

1 Like

How about configure to out-of-band interrupt for wifi ?

I see the amlogic vendor kernel 4.9 use it
and interrupt GPIO is GPIOX_7 defined in dts file

The mainline kernel use “MMC_CAP_SDIO_IRQ”
that’s in-band interrupt for wifi by sdio_data[1] pin

I think the two way interrupt cause wifi performance , I guess …

1 Like

Has anything been planned for this issue?
@spikerguy mentioned this patch

But there seems to be a fix for it:
https://lore.kernel.org/linux-amlogic/e635fee3-f5c4-2819-d6f3-a50dac55e979@gmail.com/T/#u

It is in linux-next

1 Like

I applied the patch, it appears to be very stable (when working), but there is a brcmfmac startup issue with it.
It will not always start the brcmfmac module. I have worked around it by trying to (re-)load the brcmfmac module in rc.local but that is just a hack.

@numbqq Could Khadas have a look at the WiFi issue please?
With the current kernel, WiFi fails after a few minutes and causes a hanging kernel as the opening poster reported.

1 Like

Hello @gkkpch

Yes, @Frank will check and update here.

The following patches are required for 6.1.x kernels:

https://patchwork.kernel.org/project/linux-amlogic/patch/27d89baa-b8fa-baca-541b-ef17a97cde3c@gmail.com/

https://patchwork.kernel.org/project/linux-amlogic/patch/76e042e0-a610-5ed5-209f-c4d7f879df44@gmail.com/

https://patchwork.kernel.org/project/linux-amlogic/patch/9e296859-0363-ecc4-2d99-fd0239efceff@gmail.com/

^ the last patch will work but compile warnings were flagged so I would expect Heiner to post a v2 of the patch with some changes shortly.

2 Likes

Can someone enlighten me on how to apply a patch? Do I have to use Fenix and build a new OS image from scratch or I can just live patch the OS?

I tried to install the official ubuntu image with kernel 6.0.0 but as soon as I do apt upgrade it bumps to 6.1.0 and network started to fail.

–EDIT–
Ah I see fenix already have the kernel with patches applied, maybe Khadas can update their official images provided for oowow?

Please follow the steps below to upgrade the kernel with the patches applied.

cd /tmp
wget https://dl.khadas.com/.test/vim3/linux-dtb-amlogic-mainline_1.4.2_arm64.deb
wget https://dl.khadas.com/.test/vim3/linux-image-amlogic-mainline_1.4.2_arm64.deb
sudo dpkg -i  linux-dtb-amlogic-mainline_1.4.2_arm64.deb linux-image-amlogic-mainline_1.4.2_arm64.deb
sync
sudo reboot

Please check and tell us the results.

I tried on a fresh OS, it works great!

Noob question, what happens if there is a new update on these files? Will the new change automatically be applied?

We will apply these patches to next update, so if you don’t upgrade the kerenl manually, it should be fine.

Yes but I mean if I do keep these patches that I just applied manually, would there be conflict when the next update is released?

No, there will be no confilict.

Yes, please create a new topic for your build issue.

Unfortunately, this didn’t happen yet and I have to upgrade a fleet of devices. When can we expect an update, please?

Is the VIM3 EOL? It’s been months since the issue has been patched but there is still no updated image available for flashing with OOWOW.