Mwlwifi and kernel 5.10

anybody else having issues with mwlwifi under 5.10?

I can't get it working on Espressobin Ultra which has an 88W8997 PCI-E card.
Unfortunately, it constatnly gets stuck on loading the firmware with:

[    7.911926] Loading modules backported from Linux version v5.10.16-0-gde53befa79cf
[    7.919814] Backport generated by backports.git v5.10.16-1-0-g21d2a1d2
[    7.953706] <<Marvell Mac80211 Wireless PCIE Network Driver version>>
[    7.961997] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    7.968222] ieee80211 phy0: priv->pcmd_buf = 0000000036bc6089  priv->pphys_cmd_buf = 0000000010a4d86d
[    7.975991] ieee80211 phy0: fw download start

could be unrelated but in kernel 5.5+ they added extra check to the pci driver and for ipq806x the second and third pci port didn't work as the io address was too big. Problem is that pcie doesn't display any warning about this and this results in problem loading the ath10k firmware in my case (the firmware reported problem writing on some pci address)
The fix for ipq806x was enlarge the max io address space for the entire arm arch

Wonder if it's the same case for this SoC ?

[WIP] ipq806x: add kernel 5.10 support by Ansuel · Pull Request #3954 · openwrt/openwrt · GitHub

Hi, It could be albeit it only has one PCI port.

I changed the size to 32M, it still hangs but with a status print:

[    8.297617] <<Marvell Mac80211 Wireless PCIE Network Driver version>>
[    8.305980] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    8.312139] ieee80211 phy0: priv->pcmd_buf = 000000007630fefc  priv->pphys_cmd_buf = 000000002e009770
[    8.318821] ieee80211 phy0: fw download start
[    8.488412] ieee80211 phy0: FwSize = 176684 downloaded Size = 176684 curr_iteration 65477

There is some deeper issue with the driver as it will randomly load but then crash on unrelated stuff.
mwifiex driver will load the fw and succeed, but it wont bring up the AP, it always just returns an error code.

What would be good to know if this is present only on espressobin or also on any other mvebu device.

Yes, but I only have this one to test on.

I can't even get OpenWrt to build with kernel 5.10 for my wrt3200acm.

what error? did you tried latest commit? i had some problem with some package due to a toolchain package causing problems.

Ok, an update.
Due to OpenWrt not being in sync with the mainline there was no PCIe PERST GPIO and then it was not training the link properly.

After that was fixed then there was an issue with the DTS node parser in the mwlwifi which was causing null pointers and crashing the kernel.

No kernel panic reported? strange...

There is a kernel panic, but it points to a completely wrong function that does not even get executed.
So, I did some manual prints and found that of_find_node_by_name() will fail and crash the kernel with it.

The current fix is to simply comment it out.

Also, the AW-CM276NF PCIe module used for WLAN on Espressobin Ultra has a HW bug that requires its power to be toggled off/on with a 5ms delay before PCI link training as otherwise it wont change state to D3h and that will crash the kernel as well.

Some further digging leads to the root cause, pci_bus_to_OF_node() is being used to get the PCI BUS DT node, but there is no sanity checking on what it returns.
And since It cant find a DT node, it will return NULL and then there is a print that is supposed to print the node name.
And obviously since the node is NULL we get a NULL dereference.

any progress on wifi on ebin ultra ?

What kind of progress?
Its working, mwifiex requires the legacy rates to be enabled

1 Like

Do you have wifi working on espressobin ultra ?
Can you explain how, please ?
I have tried the 21.02-RC3 and I get wifi which loop on bugs with hostapd...

Okay, I'll give a try... thanks

It will work, like I said you need to enable the legacy rates, this was the default in 19.07 but was finally changed after

1 Like

Yes, it works now fine !

I just made by command line (the 21.02 no more shows this option !)

uci set wireless.radio0.legacy_rates='1'
uci commit

and now the AcessPoint is available...

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

it is not my topic !