This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WL1271 interrupts are causing high cpu load

Other Parts Discussed in Thread: WL1271

I am using a 2.6.32 kernel (linux-2.6.32.17-psp03.01.01.39) in combination with the backports driver package, version 3.12.2-1, to enable wl1271 support on a DM365 based platform.

The kernel modules are loaded correctly (mac80211, cfg80211, wlcore, wl12xx, wlcore_sdio), the interface gets configured correctly (ifconfig wlan0 up), it's able to scan (iw wlan0 scan) and connect to an AP (iw wlan0 connect).

I'm now running some performance/endurance tests using iperf but I encounter that the CPU utilization is rather high. In my PC I'm running the command:

  iperf -s -i 2 -w 1024k &

And in the board I'm running:

  iperf -c $SERVER_IP -t 240 -i 5 -w 212k

This is the iperf output:

Client connecting to 192.168.1.18, TCP port 5001
TCP window size:  212 KByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[  3] local 192.168.1.5 port 55058 connected with 192.168.1.18 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  5.12 MBytes  8.60 Mbits/sec
[  3]  5.0-10.0 sec  5.25 MBytes  8.81 Mbits/sec
[  3] 10.0-15.0 sec  5.00 MBytes  8.39 Mbits/sec
...

But the CPU load is high:

Mem: 36540K used, 8312K free, 0K shrd, 952K buff, 25376K cached
CPU:   1% usr  55% sys   0% nic   5% idle   0% io  14% irq  23% sirq
Load average: 1.52 0.49 0.21 3/46 2329
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
 1161     2 root     SW       0   0%  44% [irq/56-wl12xx]
 1155     2 root     SW       0   0%  19% [wl12xx_wq]
 2178  2176 root     S    19876  44%  17% iperf -c 192.168.1.18 -t 240 -i 5 -w 1024k
 1163     2 root     SW       0   0%  12% [phy0]

Here, if we take out iperf, the wifi related processes are taking 75% of CPU ([irq/56-wl12xx] + [wl12xx_wq] + [phy0]) for 8.6Mbps of bandwidth. I've also detected that if the bandwidth decreases (for example If I'm further away from the AP), then CPU utilization also decreases. This matches the results in the Omap Wireless Connectivity CPU Utilization wiki (71% reported).

The process [irq/56-wl12xx] is taking most of the CPU (44%), and is related to the GIO56 where WLAN_IRQ is connected in my platform. So I've also measured the rate at which I receive MMC1 (SDIO bus) and WLAN_IRQ interrupts per second, and here are the results.

/ # cat /proc/interrupts
           CPU0
...
27: 102426966 AINTC mmc1 ...
56: 30716597 AINTC wl12xx

Interrupts per second:

# 1 sec
wifi interrupts: 1070
mmc interrupts: 5895
# 2 sec
wifi interrupts: 1420
mmc interrupts: 5739
# 3 sec
wifi interrupts: 1402
mmc interrupts: 6193
...

So, it seems that the wl12xx interrupts (betwen 1,000 and 1,400 per second) are causing the high cpu usage in the [irq/56-wl12xx] process.

I found a similar problem in the SDIO IRQ mode for hsmmc driver post for OMAPs (I'm in a DM365), but the link to the patch that supposedly solves the issue is broken, and a secondary needed patch is only explained in prose. Also, it seems to me that I'm not able to use SDIO IRQ for wifi interrupts as described in this post: WL1271 SDIO IRQ.

I'm looking out for ideas to improve the CPU utilization, any help is greatly appreciated.

  • Hi,

    Let me check this on my setup and get back to you. Meanwhile, can you please tell which driver/firmware versions you are using?

    Regards,
    Gigi Joseph.

  • Hi Joseph,

    This is the firmware:

    / # ifconfig wlan0 up
    wlcore: firmware booted (Rev 6.3.10.0.133)

    Which comes from git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git, revision 52d77db9f133afe4d2b26aeccfd603745f45fda1.

    These are the drivers:

    / # modinfo wlcore
    filename: updates/drivers/net/wireless/ti/wlcore/wlcore.ko
    author: Juuso Oikarinen <juuso.oikarinen@nokia.com>
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: no_recovery:Prevent HW recovery. FW will remain stuck.
    parm: bug_on_recovery:BUG() on fw recovery
    parm: fwlog:FW logger options: continuous, ondemand, dbgpins or disable
    parm: debug_level:wl12xx debugging level
    / # modinfo wl12xx
    filename: updates/drivers/net/wireless/ti/wl12xx/wl12xx.ko
    author: Luciano Coelho <coelho@ti.com>
    license: GPL v2
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: tcxo:TCXO clock: 19.2, 26, 38.4, 52, 16.368, 32.736, 16.8, 33.6
    parm: fref:FREF clock: 19.2, 26, 26x, 38.4, 38.4x, 52
    / # modinfo wlcore_sdio
    filename: updates/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
    author: Juuso Oikarinen <juuso.oikarinen@nokia.com>
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: dump:Enable sdio read/write dumps.
    / # modinfo mac80211
    filename: updates/net/mac80211/mac80211.ko
    description: IEEE 802.11 subsystem
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use
    parm: probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4).
    parm: beacon_loss_count:Number of beacon intervals before we decide beacon was lost.
    parm: max_probe_tries:Maximum probe tries before disconnecting (reason 4).
    parm: max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4).
    / # modinfo cfg80211
    filename: updates/net/wireless/cfg80211.ko
    description: wireless configuration support
    author: Johannes Berg
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band
    parm: ieee80211_regdom:IEEE 802.11 regulatory domain code
    / # modinfo compat
    filename: updates/compat/compat.ko
    description: Kernel backport module
    author: Luis R. Rodriguez
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5
    parm: backports_version:The git version of the backports tree used to generate this backport (v3.12.2-1-0-gb4b7ee5)
    parm: backported_kernel_version:The kernel version that was used for this backport (v3.12.2-0-g050dcf4)
    parm: backported_kernel_name:The kernel tree name that was used for this backport (Linux)
    / # modinfo compat_firmware_class
    filename: updates/compat/compat_firmware_class.ko
    description: Multi purpose firmware loading support
    author: Manuel Estrada Sainz
    license: GPL
    vermagic: 2.6.32-17-ridgerun preempt mod_unload modversions ARMv5

    This is the output of lsmod:

    / # lsmod

    wlcore_sdio 3095 0 - Live 0xbf16b000
    wl12xx 48838 0 - Live 0xbf151000
    wlcore 146278 1 wl12xx, Live 0xbf11f000
    compat_firmware_class 5459 1 wlcore, Live 0xbf117000
    mac80211 374581 2 wl12xx,wlcore, Live 0xbf09e000
    cfg80211 183010 2 wlcore,mac80211, Live 0xbf05f000
    compat 27504 6 wlcore_sdio,wl12xx,wlcore,compat_firmware_class,mac80211,cfg80211, Live 0xbf04c000
    ipv6 227335 11 mac80211, Live 0xbf000000

  • Hi,

    Sorry for the late response...
    Looks to be an issue on the processor side. Can you check this on the DM365 forum?

    Regards,
    Gigi Joseph.