Colibri IMX6ULL WB Wifi card problems, especially AP mode

Hi,

I’d like to enable connman persistent tethering in /etc/connman/main.conf. But 9 out of 10 times or more frequently WiFi card driver crashes soon after reboot. If I disable persistent tethering and start tethering by connmanctl, then chances to enable tethering increase. But if I disable it using connmanctl, then 100% of reenable attemps fail.

It is not possible to restart driver, Linux just hangs without message. I tried to unbind SDIO like this, no way
echo “2190000.usdhc” > /sys/devices/soc0/soc/2100000.aips-bus/2190000.usdhc/driver/unbind

echo "2190000.usdhc" > /sys/devices/soc0/soc/2100000.aips-bus/2190000.usdhc/subsystem/drivers/sdhci-esdhc-imx/bind



echo "2194000.usdhc" > /sys/devices/soc0/soc/2100000.aips-bus/2194000.usdhc/driver/unbind

echo "2194000.usdhc" > /sys/devices/soc0/soc/2100000.aips-bus/2194000.usdhc/subsystem/drivers/sdhci-esdhc-imx/bind

Not sure however which out of two, 2190000 or 2194000 is for WiFi.

I could live with some kind of card or interface reset, but not with reboot. Is there better known driver for W8997? Google isn’t very helpful with this.

Hi @Edward

Thanks for reporting the issue. We are looking into this and will come back soon to you.

Best regards,
Jaski

Hi @jaski.tx,

any news about perhaps better mwifiex driver? Perhaps the problem is in SDIO layer? I see some errors regarding SDIO command I/O. Thanks

Hi @Edward

We looked into this issue.
There are some updates in the mwifiex driver in the kernel version 5.2 which you can try to cherry pick and add them in the kernel 4.14.

Best regards,
Jaski

Hi @jaski.tx,

thanks, but I’m having problem cloning toradex_5.2.y from git.toradex.com. How to get it without tag? Git clone gets stuck forever.

Edward

Hi @Edward

Which commands did you use to checkout the 5.2 branch?

Best regards,
Jaski

Hi @jaski.tx,

git clone -b toradex_5.2.y https://git.toradex.com/cgit/linux-toradex.git

I successfully used similar in the past to clone 4.4 and 4.14 kernels, but always used yellow tags from git www interface for -b argument. Perhaps I’m doing something stupid, but green toradex_5.2.y tag doesn’t work. I see this for response and nothing more:

Cloning into 'linux-toradex'...

Thanks,
Edward

Hi @Edward

I can reproduce this issue. We are looking for a solution for this.

Meanwhile, you can try this command:

git clone -b toradex_5.2.y git://git.toradex.com/linux-toradex.git toradex_5.2.y

Hi @jaski.tx,

Hooray, 5.2 driver seems working! I had to edit it a bit to make compileable with 4.14. Wifi tether, wifi client, all seems good. Will try more later.

Edward

Hi Edward, Perfect that it works. May I ask to share your changes, once you have tested more? This will be very helpful for the other users.
Thanks.

Hi,

not as good as I thought. Yesterday I tried just from NFS and it worked. Booting from NAND things aren’t better than they were with old driver. I retested with old driver and there’s the same difference, NFS for some reason is good for this WiFi driver and NAND is bad… Most of the times I boot from NAND and enable tether I get this

[   46.037076] mwifiex_sdio mmc1:0001:1: CMD_RESP: cmd 0xf7 error, result=0x2
[   46.098353] mwifiex_sdio mmc1:0001:1: CMD_RESP: cmd 0x112 error, result=0x1

and few seconds later a lot of other messages ending with unregister device.

Things on NFS aren’t 100% perfect as well. SDIO unbind is fine, SDIO rebind ends with the same messages like in boot from NAND case. These bind/rebind commands are for WiFi interface:

echo "2194000.usdhc" > /sys/devices/soc0/soc/2100000.aips-bus/2194000.usdhc/driver/unbind
echo "2194000.usdhc" > /sys/devices/soc0/soc/2100000.aips-bus/2194000.usdhc/subsystem/drivers/sdhci-esdhc-imx/bind

See my quick and dirty 5.2->4.14 mwifiex driver patch attached, however it doesn’t fix problem.

Any idea?

Regards
Edward
link text

Hi @Edward

Could you share a complete dmesg log?
By the way, I have seen, that not all the new fixes from new kernel are in the toradex 5.2 kernel branch.
You can try to take the newest kernel from here, cross compile and run it on Colibri-iMX6ULL.

Best regards,
Jaski

Hi @jaski.tx,

I figured why I saw difference between NFS vs NAND boot. I’ve enabled connman service even for NFS boot. Of course connman on NFS doesn’t see ethernet connection, the only option to tether is to tether WiFi via WiFi. So, enabling WiFi tether while WiFi client is connected works. It turns out that following sequence seems working too:

  1. booting from NAND
  2. with pulled out ethernet cable or pulling it later to establish WiFi client connection
  3. enabling WiFi tether
  4. connect ethernet cable
  5. disconnect WiFi client connection

So enabling WiFi tether seems requiring established WiFi client connection, which is showstopper. What is it? Why? Issues with antenna management? Are there special tools to dedicate specific antenna for special purpose?

See attached typical dmesg when driver fails enabling WiFi tether.
dmesg

Regarding kernel sources from kernel.org. I already tried 5.2 sources from git.toradex.com. Kernel doesn’t boot. I don’t want to waste a day on sources from kernel.org. Are you sure it will boot?

Regards,
Edward

Hi @Edward

Sorry for the delayed answer.
I compiled the kernel 5.3.7 with imx_v6_v7_defconfig and it is booting.

Best regards,
Jaski

Hi @jaski.tx,

Thanks for providing compiled version here:

https://share.toradex.com/dogozsk84a4zoql?direct

It saved me a lot of time.
Well, it boots but tethering doesn’t work at all…

# connmanctl tether wifi on abcd abcd0000
Wifi SSID set
Wifi passphrase set
Error enabling wifi tethering: Not supported

WiFi driver seems operating, it sees other AP’s.

Edward

Hi @Edward

I did not check especially for Tethering. Could you share the output of iw dev?

Best regards,
Jaski