On high wifi traffic high cpu usage until WILC1000 crash
Hello, im using the WILC1000 on an custom imx6 board using the latest kernel version 5.0-rc3 and the latest driver from the dev-branch. Im running the WILC1000 as an sdio device on the mmc interface. As accesspoint im using a tp link TL-WR940N. There is no problem on establishing a connection via wifi from pc to the board. But if i try to upload a bigger file(around 100MB) the WILC1000 crashes (10-50MB transferred) and i have to restart the board (i did not implement the restart sequence until now so i have to power up it again). On my investigation i checked the wifi connection with iperf3 and every time i do this the WILC1000 crashes after some amount of time. The time is not always the same. When nothing else is running on the board the time until it crashes can be 5 to 30 minutes. But if an application is running the crash happens in several seconds. So i checked the cpu usage and found that the irq-process from the wifi takes around 30% or more cpu usage. Additionally there comes an amount of around 20% to 25% from the txq task from the wifi. So i have about 50%+ cpu usage just from the data transfer via wifi. (see first attached screenshot) I checked the process when running iperf3 and they are raising up to those values. I don't know exactly if this actually causes our WILC1000 to crash but still more than 50% cpu usage is a way too much for data transfer via wifi. Also there are no kernel messages when the wifi chip crashes only when it try to come up again(because of the missing power up sequence which is only implemented in the device tree see second attached screenshot). To fasten up those crashes for testing i just have to ssh when an iperf3 process is running and start sth. like top or just do a little work on ssh which is most time enough to reproduce it.
On further tests an other result was that on udp the crashes won't happen until i put some debug messages into the driver code. Some simple printk in rx queue part leading it also to crash. On the other hand tcp always crashes it just differs in time. I also changed the bitrates on tcp/udp which made not much difference. So i think there is an issue in either the firmware or the driver it self which has a problem with the irq handling or any buffering issue.


Hello, I can confirm similar problems with high cpu load on a ti AM3352 CPU based board (similar to the Beaglebone Black) with 4.14.67 Ti CPU-SDK Kernel and WILC3000 with latest dev-drivers&fw.
Here is one observation from our Microchip Salesforce case number 00328657 (Date/Time Opened | 9/6/2018 10:39 AM), which Microchip also reproduced:
Please note the load average before and after loading and unloading the wilc-spi module, with the usual system load settling in at 2.0 with wifi0 device up(which complicates system health monitoring...):
root@casenio:~# uptime 13:46:20 up 1:05, 1 user, load average: 0.21, 1.77, 2.70 root@casenio:~# lsmod Module Size Used by xt_nat 2255 3 ipt_MASQUERADE 1280 1 nf_nat_masquerade_ipv4 3076 1 ipt_MASQUERADE iptable_nat 1906 1 nf_conntrack_ipv4 8376 1 nf_defrag_ipv4 1613 1 nf_conntrack_ipv4 nf_nat_ipv4 5775 1 iptable_nat nf_nat 22833 3 xt_nat,nf_nat_masquerade_ipv4,nf_nat_ipv4 nf_conntrack 143518 4 nf_conntrack_ipv4,nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat xt_TCPMSS 3291 1 xt_tcpudp 2315 4 iptable_filter 1604 1 ip_tables 12388 2 iptable_filter,iptable_nat x_tables 19229 6 xt_nat,ip_tables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_TCPMSS root@casenio:~# modprobe wilc-spi root@casenio:~# lsmod Module Size Used by wilc_spi 188693 0 xt_nat 2255 3 ipt_MASQUERADE 1280 1 nf_nat_masquerade_ipv4 3076 1 ipt_MASQUERADE iptable_nat 1906 1 nf_conntrack_ipv4 8376 1 nf_defrag_ipv4 1613 1 nf_conntrack_ipv4 nf_nat_ipv4 5775 1 iptable_nat nf_nat 22833 3 xt_nat,nf_nat_masquerade_ipv4,nf_nat_ipv4 nf_conntrack 143518 4 nf_conntrack_ipv4,nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat xt_TCPMSS 3291 1 xt_tcpudp 2315 4 iptable_filter 1604 1 ip_tables 12388 2 iptable_filter,iptable_nat x_tables 19229 6 xt_nat,ip_tables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_TCPMSS root@casenio:~# uptime 13:51:59 up 1:11, 1 user, load average: 0.22, 0.79, 1.97 root@casenio:~# ifconfig wlan0 up root@casenio:~# uptime 13:54:54 up 1:14, 1 user, load average: 2.04, 1.34, 1.98 root@casenio:~# rmmod wilc-spi root@casenio:~# lsmod Module Size Used by xt_nat 2255 3 ipt_MASQUERADE 1280 1 nf_nat_masquerade_ipv4 3076 1 ipt_MASQUERADE iptable_nat 1906 1 nf_conntrack_ipv4 8376 1 nf_defrag_ipv4 1613 1 nf_conntrack_ipv4 nf_nat_ipv4 5775 1 iptable_nat nf_nat 22833 3 xt_nat,nf_nat_masquerade_ipv4,nf_nat_ipv4 nf_conntrack 143518 4 nf_conntrack_ipv4,nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat xt_TCPMSS 3291 1 xt_tcpudp 2315 4 iptable_filter 1604 1 ip_tables 12388 2 iptable_filter,iptable_nat x_tables 19229 6 xt_nat,ip_tables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_TCPMSS root@casenio:~# uptime 13:56:45 up 1:16, 1 user, load average: 0.87, 1.24, 1.88
I also opened a case with number 00376318