Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Looking at the ath11k (unless I'm missing something) but using the ahb bus version shouldn't need QRTR/MHI

The fact that it can't probe without sound like something is broken (or again .... I'm blind)

I can tell you that without it nothing happens, MHI you don't need to AHB but QRTR has been needed so far.
I mean you can try disabling it and see what happens(Maybe they fixed it in later versions).

I'll have a look, I got half way counting send / receive buffers over AHB.

I think that some messages are sent to the remoteproc but never gets a response (so doesn't get cleaned up)

I wouldnt be surprised actually as the remoteproc support that is currently used is old QCA patches that have been rebased on 5.10 since they never bothered to actually fix the remarks and send new patches.

Yeah, tho even in the remoteproc code the leak should be detected by kmemleak

Yeah, those should be easy for it to find though there really isn't too many options for the remoteproc driver itself to leak, all it does is allow booting the remoteproc with fw, stopping etc.
All of the fancy communication happens via other means and those are prime space for memory leaks, QMI/WMI for example are just ideal for memory leaks

Yeah very true, I'll do some more digging on this.

Maybe just enable kernel trace on all kernel alloc and free, with this much memory leaking you would hope it would be obvious as to what's leaking.

I don't know if that would work as there should be a lot, like really a lot of memory allocations and freeing going on all the time.
No way that you can print that somehow in a humanly readable way, but kernel GDB may be an option

I was thinking of trying "/sys/kernel/debug/tracing/" with just kmalloc events. It will be very very noisy, but if we can get the call address from system.map we could try and account for the allocation events. As we are leaking 100s if megabytes the location for that would hopefully be obvious.

We would have to stream those traces off the device tho (and yeah the traces would be massive)

Agreed, that seems like a viable path but how to pipe the trace stream is the issue here due to sheer amount of calls

John's 512MB patch took a different approach that maybe @robimarko could take a look at.

That's a bit different as they are just using QSDK kernel and packages for everything, and there you have compile-time selectable memory profile for the DTS

1 Like

Hi @robimarko,
Thank you for a grate work. I have installed your latest build(generated after actions) on AX6. Overall the situation is good. Wifi 2.4 and 5 works fine for me, i have 3 SSID per each radio.

I have a question:

  1. Is the build without luci? Because after installation web interface was not reachable. I installed it manually via ssh.

Yes, luci is not included in robimarko's automated builds but you can fork the repo and add it to create your own custom builds.
For example, I adapted the build to my needs adding luci, WiFi on default config and some vpn packages: https://github.com/rodriguezst/openwrt/blob/rodriguezst-ci/.github/workflows/ipq807x.yaml

1 Like

I will add LuCI in the next builds, completely forgot that it and its really useful.
I also forgot to add the NSS components as well.

9 Likes

Hi @robimarko
Thanks a lot for your hard work on adding support for AX3600 and similar devices.
I did a quick look into what's in the backported 5.15 (https://hauke-m.de/files/backports-test/backports-5.15-rc6-test12.tar.xz) and what is in the Kvalo's kernel version (https://kernel.googlesource.com/pub/scm/linux/kernel/git/kvalo/ath/+archive/refs/tags/ath-202110181235.tar.gz).
I did compared content of /drivers/net/wireless/ath/ath11k/ directories from both and the diff was over 420KB.
https://we.tl/t-dR76LeTwBX
I think it is fair to say the ath11k is still work-in-progress :slight_smile:

1 Like

Is there any way that we can make use of the official overlay partition (mtd14)?

Probably, the sysupgrade would need to be extended to add logic to actually use it

Hi, can I don't have another router, can you guide me to running hostapd and server to unlock ssh for redmi ax6. Thank you very much.

@dchard A weird thing, I have left an 2.4G AP running for around 8 hours now on the AX9000, it had 1 client for the first 2 hours and then nothing.

root@OpenWrt:/# uptime 
 08:16:30 up 12:33,  load average: 0.00, 0.00, 0.00

And I don't see the leak, memory is the same as when ath11k is started, it only drops by 20-30MB on the first client.

root@OpenWrt:/# cat /proc/meminfo 
MemTotal:         885328 kB
MemFree:          688720 kB
MemAvailable:     677268 kB

But note that this has got no NSS offloading stuff installed.

2 Likes