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.

Linux/WL1807MOD: Driver / Firmware seems to load fine but any wireless action crashes driver with "wlcore: Scan completed due to error."

Part Number: WL1807MOD


Tool/software: Linux

Hi,

I am using a WL1807MOD on an iMX6DL based board. I have built the kernel with the driver and built and copied the latest wl firmware binary.

The driver seems to load fine, lsmod produces:

Module                  Size  Used by
wl18xx                 73240  0
wlcore                154062  1 wl18xx
mac80211              337011  2 wl18xx,wlcore
cfg80211              201405  3 wl18xx,wlcore,mac80211
bluetooth             310669  2
wlcore_sdio             5853  0
galcore               331844  4

I used the config script at /usr/sbin/wlconf/ and it seemed to work fine, and the interface seems to come up fine:

root@colibri-imx6:~# ifconfig wlan0 up
[   53.466789] wlcore: using inverted interrupt logic: 2
[   53.543046] wlcore: PHY firmware version: Rev 8.2.0.0.242
[   53.606779] wlcore: firmware booted (Rev 8.9.0.0.79)
[   53.631678] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

I can check on the scope and see that the enable pin is toggled correctly when the link comes up, and the IRQ pin toggles the level shifter normally. The interrupts seem to be registered:

251:          4  gpio-mxc  10 Edge      wl18xx

However, trying a scan or connect crashes the driver with this message:

[   99.682869] wlcore: Scan completed due to error.
[   99.687520] ------------[ cut here ]------------
[   99.692220] WARNING: CPU: 0 PID: 112 at /media/tpeterson/Part2/oe-core-toradex/build/tmp-glibc/work-shared/colibri-imx6/kernel-source/drivers/net/wireless/ti/wlcore/main.c:796 wl12xx_queue_recovery_work.part.10+0x60/0x64 [wlcore]
[   99.712646] Modules linked in: wl18xx wlcore mac80211 cfg80211 bluetooth wlcore_sdio galcore(O)
[   99.721597] CPU: 0 PID: 112 Comm: kworker/u4:1 Tainted: G           O    4.9.84-2.8.2+gb2a7f2f #22
[   99.730571] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   99.737162] Workqueue: phy0 wl1271_scan_complete_work [wlcore]
[   99.743024] Backtrace:
[   99.745528] [<8010ba5c>] (dump_backtrace) from [<8010bd34>] (show_stack+0x18/0x1c)
[   99.753119]  r7:00000009 r6:600e0013 r5:00000000 r4:80b1b030
[   99.758807] [<8010bd1c>] (show_stack) from [<803fe064>] (dump_stack+0x90/0xa4)
[   99.766059] [<803fdfd4>] (dump_stack) from [<80125a98>] (__warn+0xec/0x104)
[   99.773040]  r7:00000009 r6:7f192378 r5:00000000 r4:00000000
[   99.778725] [<801259ac>] (__warn) from [<80125b68>] (warn_slowpath_null+0x28/0x30)
[   99.786316]  r9:00000000 r8:8638fbb0 r7:00000000 r6:86898d00 r5:86898d3c r4:86898d00
[   99.794120] [<80125b40>] (warn_slowpath_null) from [<7f17b960>] (wl12xx_queue_recovery_work.part.10+0x60/0x64 [wlcore])
[   99.804979] [<7f17b900>] (wl12xx_queue_recovery_work.part.10 [wlcore]) from [<7f17eeb8>] (wl12xx_queue_recovery_work+0x1c/0x20 [wlcore])
[   99.817250]  r5:86898d3c r4:86899020
[   99.820900] [<7f17ee9c>] (wl12xx_queue_recovery_work [wlcore]) from [<7f190c28>] (wl1271_scan_complete_work+0x128/0x12c [wlcore])
[   99.832607] [<7f190b00>] (wl1271_scan_complete_work [wlcore]) from [<8013cf08>] (process_one_work+0x1f0/0x418)
[   99.842627]  r8:00000000 r7:86a84e00 r6:84002800 r5:86336780 r4:86899020
[   99.849353] [<8013cd18>] (process_one_work) from [<8013debc>] (worker_thread+0x68/0x5fc)
[   99.857465]  r10:80b02d00 r9:00000088 r8:ffffe000 r7:84002818 r6:86336798 r5:84002800
[   99.865304]  r4:86336780
[   99.867864] [<8013de54>] (worker_thread) from [<80143114>] (kthread+0x110/0x118)
[   99.875281]  r10:00000000 r9:00000000 r8:8013de54 r7:86336780 r6:86344000 r5:863349c0
[   99.883120]  r4:00000000
[   99.885682] [<80143004>] (kthread) from [<80107df0>] (ret_from_fork+0x14/0x24)
[   99.892922]  r8:00000000 r7:00000000 r6:00000000 r5:80143004 r4:863349c0
[   99.899712] ---[ end trace 57159835bee525df ]---
[   99.910856] wlcore: Hardware recovery in progress. FW ver: Rev 8.9.0.0.79
[   99.925992] wlcore: pc: 0x0, hint_sts: 0x00000048 count: 1
[   99.931796] wlcore: down
[   99.936059] ieee80211 phy0: Hardware restart was requested

Any thoughts on what could cause this issue? The above error happens about 30 s after trying a scan or connection.

  • Hi,
    Can you confirm the following
    - sdio/mmc is configured as non-removable , cap-power-off-card ?
    - wlan_en remains asserted from the time wlan0 interface is brought up ?

    Thanks
    Saurabh
  • Yes, this is from the device tree:

    /* wlcore sdio */
    &usdhc2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&pinctrl_usdhc2>;
    	bus-width = <4>;
    	vmmc-supply = <&wlan_en_reg>; 
    	no-1-8-v;
    	non-removable;
    
    	status = "okay";
    
    	keep-power-in-suspend;
    	enable-sdio-wakeup;
       	non-removable;    
    
    
        	cap-power-off-card;
    
    	#address-cells = <1>;
    	#size-cells = <0>;
    
    	disable-wp;
    	
    	
    	wlcore: wlcore@2 {
    		compatible = "ti,wl1807";
    		reg = <2>;
    		interrupt-parent = <&gpio6>;
    		interrupts = <10 IRQ_TYPE_EDGE_FALLING>; /* Level shift on actual board reverses polarity, changed to falling edge */
    		tcxo-clock-frequency = <26000000>; 	
    		status = "okay";
    	};
    };

    The Wlan_en does stay asserted the entire time, I have checked this on a scope. It also properly goes low when the interface is set 'down'.

    Thanks,

    Thomas

  • Hi,

    What is the output of:
    cat /proc/interrupts | grep wl18xx
    right after boot, after bringup of the interface and after the failed scan command?

    Ususally erros like this indicated a problem with wlan_irq pin configuration/connection.
    I believe the host is missing interrupts from wl18xx.

    Br,
    Eyal
  • Hi Eyal,

    After boot:

    root@colibri-imx6:~# cat /proc/interrupts | grep wl
    251:          0  gpio-mxc  10 Edge      wl18xx

    After bringup:

    oot@colibri-imx6:/home# ifconfig wlan0 up
    [   56.847080] wlcore: using inverted interrupt logic: 2
    [   56.923340] wlcore: PHY firmware version: Rev 8.2.0.0.242
    [   57.049237] wlcore: firmware booted (Rev 8.9.0.0.79)
    [   57.078727] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    root@colibri-imx6:/home# cat /proc/interrupts | grep wl
    251:          2  gpio-mxc  10 Edge      wl18xx

    After failed scan:

    root@colibri-imx6:/home# cat /proc/interrupts | grep wl
    251:          4  gpio-mxc  10 Edge      wl18xx

    Note this is the device tree binding for wlcore (in usdhc2):

    wlcore: wlcore@2 {
    		compatible = "ti,wl1807";
    		reg = <2>;
    		interrupt-parent = <&gpio6>;
    		interrupts = <10 IRQ_TYPE_EDGE_FALLING>; /*tdp change to falling b/c of design on actual board */	
    		tcxo-clock-frequency = <26000000>;
    		status = "okay";
    	};

    I have verified that the pin is muxed to gpio as well.

  • Should the interrupt be rising edge or high level? The datasheet seems to suggest rising-edge, but I noticed most other dts files with 183x in them seem to use high level. If I try low level on our board (since the logic is inverted) it hangs indefinitely on bringing up wlan0, with this error:

    root@colibri-imx6:~# ifconfig wlan0 up
    [   34.337463] wlcore: using inverted interrupt logic: 8
    [   34.414059] wlcore: PHY firmware version: Rev 8.2.0.0.242
    [   34.476812] wlcore: firmware booted (Rev 8.9.0.0.79)
    [   34.547675] random: crng init done
    [   51.043067] INFO: task sd-resolve:236 blocked for more than 10 seconds.
    [   51.049712]       Tainted: G           O    4.9.84-2.8.2+gb2a7f2f #25
    [   51.056193] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [   51.064047] sd-resolve      D    0   236      1 0x00000000
    [   51.069554] Backtrace:
    [   51.072039] [<807f93c4>] (__schedule) from [<807f9940>] (schedule+0x44/0xa4)
    [   51.079131]  r10:00000000 r9:80b3e86c r8:00000002 r7:80b3e868 r6:863d7900 r5:ffffffff
    [   51.086986]  r4:ffffe000
    [   51.089535] [<807f98fc>] (schedule) from [<807f9cd0>] (schedule_preempt_disabled+0x10/0x14)
    [   51.097915]  r5:ffffffff r4:80b3e864
    [   51.101505] [<807f9cc0>] (schedule_preempt_disabled) from [<807fb1b0>] (__mutex_lock_slowpath+0xa4/0x158)
    [   51.111100] [<807fb10c>] (__mutex_lock_slowpath) from [<807fb2bc>] (mutex_lock+0x58/0x5c)
    [   51.119311]  r9:00000000 r8:87be3e24 r7:86f30e40 r6:00000014 r5:86c1c800 r4:80b3e864
    [   51.127110] [<807fb264>] (mutex_lock) from [<80702dc4>] (rtnetlink_rcv+0x1c/0x34)
    [   51.134618]  r5:86c1c800 r4:86f30e40
    [   51.138209] [<80702da8>] (rtnetlink_rcv) from [<8071656c>] (netlink_unicast+0x18c/0x224)
    [   51.146331]  r5:86c1c800 r4:860d8c00
    [   51.149918] [<807163e0>] (netlink_unicast) from [<807169cc>] (netlink_sendmsg+0x2f4/0x360)
    [   51.158209]  r9:00000014 r8:00000000 r7:00000000 r6:86f30e40 r5:86c1c800 r4:87be3ed8
    [   51.165994] [<807166d8>] (netlink_sendmsg) from [<806d2d70>] (sock_sendmsg+0x1c/0x2c)
    [   51.173851]  r10:00000000 r9:87be2000 r8:80107ee4 r7:00000122 r6:85322a80 r5:00000000
    [   51.181684]  r4:00000000
    [   51.184248] [<806d2d54>] (sock_sendmsg) from [<806d3d7c>] (SyS_sendto+0x94/0xf0)
    [   51.191659] [<806d3ce8>] (SyS_sendto) from [<80107d20>] (ret_fast_syscall+0x0/0x48)
    [   51.199346]  r6:76b09638 r5:0000000c r4:76b0962c

  • Hi,

    This is really dependent on the host processor and the target hardware, type of external pulls etc.

    Some hosts are better with level interrupts and with others, edge interrupt is better.

    Based on the fact that right after ifconfig wlan0 up, you already see 2 interrupts (I would have expected to see 1) and and after scan command you only see two additional ones, i believe you have not set the wlan_irq correctly. Try changing the pullup/pulldown configuration in your .dts pin muxing . You didn't paste this part.

    Best Regards,

    Eyal

  • Hi Eyal,

    Thanks for the info. The pad control for the irq pad is :

    MX6QDL_PAD_NANDF_RB0__GPIO6_IO10     PAD_CTRL_HYS_PU     /* PAD_CTRL_HYS_PU  is 0x1b0b0  */

    Which is a 100k pull up mode. The level shifter for the IRQ is a simple mosfet that has a pull down on the WL1807 side and an (external) 10k pullup on the processor side, which seems to translate the levels fine with a reasonable rise/fall time. I can try an internal pulldown on the irq pin as well but I would think there wouldn't be much effect since the external pullup is 10k.

    The SDIO lines are also using 100k internal pullups on the processor side, but the level shifter itself (TXS0108) has 40k internal pullups as well so the processor pullups aren't doing much.

    The datasheet seems to suggest that the IRQ line on the 1807 is configurable to different polarities, how is this done? We are assuming it is not changing from default (active high) because we need it active high on the 1807 side and active low on the processor side.

  • We were able to resolve this issue- we modified the pcb so that the IRQ would be level shifted directly (not inverted logic) and changed the IRQ pin to LEVEL_HIGH instead of LEVEL_LOW and now it works. It seems that something doesn't work right when you attempt to do low level (on processor side) IRQ with high level on WL side.