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.

WL1801MOD not waking from ELP

Other Parts Discussed in Thread: WL1801MOD, WL1271

Hello,

I'm running into an issue with the WL1801MOD not waking from the ELP state.

I'm currently running the wlcore_sdio/wlcore/wl18xx drivers from the v3.18.8 Linux kernel, since that's what comes with the android-x86 4.4.4-r2 code.  When I attempt to run wpa_supplicant and the driver tries to wake the chip I get the following:

<6>[ 168.072016] wlcore: mac80211 config psm off power 0 idle changed 0x10
<7>[ 168.072076] wlcore_sdio: READ from 0x50e8
<7>[ 168.072081] wlcore_sdio: READ 00000000: 10 00 00 00
<7>[ 168.072115] wlcore_sdio: READ from 0x54f0
<7>[ 168.072119] wlcore_sdio: READ 00000000: 02 00 00 00
<7>[ 168.072153] wlcore_sdio: WRITE to 0x50f0
<7>[ 168.072157] wlcore_sdio: WRITE 00000000: 10 00 00 00
<6>[ 168.101967] wlcore: elp work
<6>[ 168.101982] wlcore: chip to elp
<7>[ 168.101996] wlcore_sdio: WRITE to 0x1fffc
<7>[ 168.102010] wlcore_sdio: WRITE 00000000: 00 00 00 00
<6>[ 168.113119] wlcore: mac80211 configure filter changed 0 total 80000000
<6>[ 168.113133] wlcore: waking up chip from elp
<7>[ 168.113144] wlcore_sdio: WRITE to 0x1fffc
<7>[ 168.113155] wlcore_sdio: WRITE 00000000: 01 00 00 00
<3>[ 170.613836] wlcore: ERROR ELP wakeup timeout!
<4>[ 170.613903] WARNING: CPU: 0 PID: 517 at /home/stephend/git/vgr_android/android-x86/kernel/drivers/net/wireless/ti/wlcore/main.c:789 wl12xx_queue_recovery_work+0x20/0x49 [wlcore]()
<0>[ 170.613912] Modules linked in: wl18xx wlcore mac80211 cfg80211 wlcore_sdio iTCO_wdt snd_hda_codec_idt snd_hda_codec_generic pppoe i2c_i801 lpc_ich snd_hda_intel snd_hda_controller snd_h
da_codec snd_hwdep snd_pcm snd_timer snd soundcore i915 i2c_algo_bit drm_kms_helper drm iosf_mbi snd_soc_sst_acpi 8250_dw pwm_lpss_platform pwm_lpss [last unloaded: wlcore_sdio]
<0>[ 170.614265] [<f840d16d>] ? wl12xx_queue_recovery_work+0x20/0x49 [wlcore]
<0>[ 170.614323] [<f840d16d>] ? wl12xx_queue_recovery_work+0x20/0x49 [wlcore]
<0>[ 170.614369] [<f8414b66>] ? wl1271_ps_elp_wakeup+0x149/0x183 [wlcore]
<0>[ 170.614429] [<f840a68a>] ? wl1271_op_configure_filter+0x3e/0xbe [wlcore]
<6>[ 170.614676] wlcore: Hardware recovery in progress. FW ver: Rev 8.8.0.0.13
<6>[ 170.614688] wlcore: mem_start 00700000 mem_size 0000030C
<6>[ 170.614697] wlcore: reg_start 00802000 reg_size 00014578
<6>[ 170.614707] wlcore: mem2_start 00B00404 mem2_size 00001000
<6>[ 170.614716] wlcore: mem3_start 00C00000 mem3_size 00000400
<4>[ 170.614769] WARNING: CPU: 0 PID: 517 at /home/stephend/git/vgr_android/android-x86/kernel/drivers/net/wireless/ti/wlcore/io.h:65 wlcore_set_partition+0x8a/0x2b7 [wlcore]()
<0>[ 170.614777] Modules linked in: wl18xx wlcore mac80211 cfg80211 wlcore_sdio iTCO_wdt snd_hda_codec_idt snd_hda_codec_generic pppoe i2c_i801 lpc_ich snd_hda_intel snd_hda_controller snd_h
da_codec snd_hwdep snd_pcm snd_timer snd soundcore i915 i2c_algo_bit drm_kms_helper drm iosf_mbi snd_soc_sst_acpi 8250_dw pwm_lpss_platform pwm_lpss [last unloaded: wlcore_sdio]
<0>[ 170.614916] Workqueue: phy0 wl1271_recovery_work [wlcore]
<0>[ 170.615064] [<f84120a6>] ? wlcore_set_partition+0x8a/0x2b7 [wlcore]
<0>[ 170.615125] [<f84120a6>] ? wlcore_set_partition+0x8a/0x2b7 [wlcore]
<0>[ 170.615162] [<f840d898>] ? wl1271_recovery_work+0x24f/0x481 [wlcore]
<0>[ 170.615235] [<f840a6fb>] ? wl1271_op_configure_filter+0xaf/0xbe [wlcore]
<6>[ 170.615485] wlcore: mac80211 remove interface
<6>[ 170.615492] wlcore: down
<6>[ 170.615516] wl12xx_sdio_power_on: Entry
<6>[ 170.636058] wl12xx_sdio_power_on: Calling mmc_power_save_host
<6>[ 170.638588] wl12xx_sdio_power_on: Exit
<6>[ 170.638711] wlcore: mac80211 stop

Other postings I found on this forum seem to point to a misconfigured interrupt, or voltage level translation issues.  I don't think that's the case here since I can see the interrupt count incrementing after attempting to start wpa_supplicant:

root@x86:/ # cat /proc/interoot@x86:/ # cat /proc/interrupts
CPU0
0: 69 IO-APIC-edge timer
4: 4172 IO-APIC-edge serial
8: 0 IO-APIC-edge rtc0
9: 0 IO-APIC-fasteoi acpi
17: 1927 IO-APIC 17-fasteoi mmc0
18: 16952 IO-APIC 18-fasteoi mmc1
22: 0 IO-APIC 22-fasteoi i801_smbus
234: 34 BYT-GPIO 17 wl18xx
261: 30 PCI-MSI-edge xhci_hcd
262: 1786 PCI-MSI-edge i915
263: 290 PCI-MSI-edge snd_hda_intel
NMI: 2 Non-maskable interrupts
LOC: 38029 Local timer interrupts
SPU: 0 Spurious interrupts
PMI: 2 Performance monitoring interrupts
IWI: 0 IRQ work interrupts
RTR: 0 APIC ICR read retries
TRM: 0 Thermal event interrupts
THR: 0 Threshold APIC interrupts
MCE: 0 Machine check exceptions
MCP: 1 Machine check polls
ERR: 0
MIS: 0

I have also experimented with removing the code for entering and exiting ELP to see if that would allow the driver to reach a point where it could scan for access points.  I no longer get any trace dumps in the kernel doing that, but wpa_supplicant still fails to start.  I get the following information from logcat:

root@x86:/ # logcat | grep -i wpa
I/dalvikvm( 2018): Could not find method android.view.View.getTransitionName, referenced from method com.google.android.finsky.navigationmanager.NavigationManager.showPage
D/wpa_supplicant( 2418): wpa_supplicant v2.1-devel-4.4.4
D/wpa_supplicant( 2418): random: Trying to read entropy from /dev/random
I/wpa_supplicant( 2418): Successfully initialized wpa_supplicant
D/wpa_supplicant( 2418): Initializing interface 'wlan0' conf '/system/etc/wifi/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 2418): Configuration file '/system/etc/wifi/wpa_supplicant.conf' -> '/system/etc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 2418): Reading configuration file '/system/etc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 2418): ctrl_interface='wlan0'
D/wpa_supplicant( 2418): update_config=1
D/wpa_supplicant( 2418): eapol_version=1
D/wpa_supplicant( 2418): ap_scan=1
D/wpa_supplicant( 2418): fast_reauth=1
I/wpa_supplicant( 2418): rfkill: Cannot open RFKILL control device
D/wpa_supplicant( 2418): nl80211: RFKILL status not available
D/wpa_supplicant( 2418): nl80211: Supports Probe Response offload in AP mode
D/wpa_supplicant( 2418): nl80211: Using driver-based off-channel TX
D/wpa_supplicant( 2418): nl80211: Use separate P2P group interface (driver advertised support)
D/wpa_supplicant( 2418): nl80211: Enable multi-channel concurrent (driver advertised support)
D/wpa_supplicant( 2418): nl80211: interface wlan0 in phy phy0
D/wpa_supplicant( 2418): nl80211: Set mode ifindex 4 iftype 2 (STATION)
D/wpa_supplicant( 2418): nl80211: Subscribe to mgmt frames with non-AP handle 0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 04 0a
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 04 0b
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 04 0c
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 04 0d
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=1): 06
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 0a 07
D/wpa_supplicant( 2418): nl80211: Register frame type=0xd0 nl_handle=0x40bc0a20
D/wpa_supplicant( 2418): nl80211: Register frame match - hexdump(len=2): 0a 11
D/wpa_supplicant( 2418): netlink: Operstate: linkmode=1, operstate=5
D/wpa_supplicant( 2418): nl80211: driver param='(null)'
D/wpa_supplicant( 2418): nl80211: Regulatory information - country=00
D/wpa_supplicant( 2418): nl80211: 2402-2472 @ 40 MHz
D/wpa_supplicant( 2418): nl80211: 2457-2482 @ 40 MHz
D/wpa_supplicant( 2418): nl80211: 2474-2494 @ 20 MHz
D/wpa_supplicant( 2418): nl80211: 5170-5250 @ 160 MHz
D/wpa_supplicant( 2418): nl80211: 5250-5330 @ 160 MHz
D/wpa_supplicant( 2418): nl80211: 5490-5730 @ 160 MHz
D/wpa_supplicant( 2418): nl80211: Added 802.11b mode based on 802.11g information
D/wpa_supplicant( 2418): wlan0: Own MAC address: d0:ff:50:78:37:76
D/wpa_supplicant( 2418): wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 2418): wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 2418): wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 2418): wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 2418): wlan0: RSN: flushing PMKID list in the driver
D/wpa_supplicant( 2418): nl80211: Flush PMKIDs
D/wpa_supplicant( 2418): wlan0: State: DISCONNECTED -> INACTIVE
D/wpa_supplicant( 2418): TDLS: TDLS operation not supported by driver
D/wpa_supplicant( 2418): TDLS: Driver uses internal link setup
D/wpa_supplicant( 2418): WPS: Set UUID for interface wlan0
D/wpa_supplicant( 2418): WPS: UUID based on MAC address - hexdump(len=16): 43 cc 67 05 80 77 5a 3e b5 7d 45 87 e4 03 3c dc
D/wpa_supplicant( 2418): EAPOL: SUPP_PAE entering state DISCONNECTED
D/wpa_supplicant( 2418): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 2418): nl80211: Set supplicant port unauthorized for 00:00:00:00:00:00
D/wpa_supplicant( 2418): EAPOL: KEY_RX entering state NO_KEY_RECEIVE
D/wpa_supplicant( 2418): EAPOL: SUPP_BE entering state INITIALIZE
D/wpa_supplicant( 2418): EAP: EAP entering state DISABLED
D/wpa_supplicant( 2418): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 2418): nl80211: Set supplicant port unauthorized for 00:00:00:00:00:00
D/wpa_supplicant( 2418): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 2418): nl80211: Set supplicant port unauthorized for 00:00:00:00:00:00
E/wpa_supplicant( 2418): mkdir[ctrl_interface=wlan0]: Read-only file system
E/wpa_supplicant( 2418): Failed to initialize control interface 'wlan0'.
E/wpa_supplicant( 2418): You may have another wpa_supplicant process already running or the file was
E/wpa_supplicant( 2418): left by an unclean termination of wpa_supplicant in which case you will need
E/wpa_supplicant( 2418): to manually remove this file before starting wpa_supplicant again.
D/wpa_supplicant( 2418): Failed to add interface wlan0
D/wpa_supplicant( 2418): wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=00:00:00:00:00:00 reason=3 state=INACTIVE
D/wpa_supplicant( 2418): TDLS: Tear down peers
D/wpa_supplicant( 2418): wlan0: No keys have been configured - skip key clearing
D/wpa_supplicant( 2418): wlan0: State: INACTIVE -> DISCONNECTED
D/wpa_supplicant( 2418): wpa_driver_nl80211_set_operstate: operstate 0->0 (DORMANT)
D/wpa_supplicant( 2418): netlink: Operstate: linkmode=-1, operstate=5
D/wpa_supplicant( 2418): EAPOL: External notification - portEnabled=0
D/wpa_supplicant( 2418): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 2418): nl80211: Set supplicant port unauthorized for 00:00:00:00:00:00
D/wpa_supplicant( 2418): EAPOL: External notification - portValid=0
D/wpa_supplicant( 2418): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 2418): nl80211: Set supplicant port unauthorized for 00:00:00:00:00:00
D/wpa_supplicant( 2418): wlan0: No keys have been configured - skip key clearing
D/wpa_supplicant( 2418): wlan0: Cancelling delayed sched scan
D/wpa_supplicant( 2418): wlan0: Cancelling scan request
D/wpa_supplicant( 2418): wlan0: P2P: Station mode scan operation not pending anymore (sta_scan_pending=0 p2p_cb_on_scan_complete=0)
D/wpa_supplicant( 2418): wlan0: Cancelling authentication timeout
D/wpa_supplicant( 2418): netlink: Operstate: linkmode=0, operstate=6
D/wpa_supplicant( 2418): nl80211: Set mode ifindex 4 iftype 2 (STATION)
D/wpa_supplicant( 2418): nl80211: Unsubscribe mgmt frames handle 0x40bc0a20 (mode change)

Has anyone else run into similar issues?

Thanks,
Steve

  • Hi Steve,

    You can try to increase WL1271_WAKEUP_TIMEOUT (wlcore/ps.c) and see if it helps.

    Regards,
    Gigi Joseph.
  • Thanks for the suggestion.

    I forgot to mention in the original post, but I did try this.  I increased the timeout from 500ms to 2500ms, and the only difference in behavior was that the timeout took two seconds longer to occur.

    -Steve

  • Hi Steve,

    Then I believe it is because of the WLAN_IRQ.
    Do you actually see the count increasing in "/proc/interrupts" after you issue the wake up command?

    Btw, which driver version are you running?

    Regards,
    Gigi Joseph.
  • I know that the interrupt count increases after calling wpa_supplicant; the relevant line from /proc/interrupts is highlighted in the original post.

    I'm not sure how I would limit checking the interrupt count to just before/after the wake up command is issued by the driver, instead of across the entire wpa_supplicant call. Is there some userspace tool I can use that will just cause the driver to issue a wakeup command?

    I'm currently running the drivers that are in the mainline Linux kernel as of v3.18.8

    Thanks,
    Steve
  • I have a build where I disabled issuing the ELP sleep/wake commands via the following changes in wlcore/ps.c

    In wl1271_elp_work:
    wl1271_debug(DEBUG_PSM, "chip to elp");
    wl1271_debug(DEBUG_PSM, "SKIPPING PUTTING CHIP IN ELP");
    /*
    ret = wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_SLEEP);
    if (ret < 0) {
    wl1271_debug(DEBUG_PSM, "Failed to write ELPCTRL_SLEEP to HW_ACCESS_ELP_CTRL_REG");
    wl12xx_queue_recovery_work(wl);
    goto out;
    }
    */

    In wl1271_ps_elp_wakeup:
    /*
    ret = wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_WAKE_UP);
    if (ret < 0) {
    wl1271_debug(DEBUG_PSM, "Failed to write ELPCTRL_WAKE_UP to HW_ACCESS_ELP_CTRL_REG");
    wl12xx_queue_recovery_work(wl);
    goto err;
    }

    if (!pending) {
    ret = wait_for_completion_timeout(
    &compl, msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT));
    if (ret == 0) {
    wl1271_error("ELP wakeup timeout!");
    wl12xx_queue_recovery_work(wl);
    ret = -ETIMEDOUT;
    goto err;
    }
    }
    */
    With those changes in place so the driver can continue beyond the initial wakeup failure I can see the following in the kernel log:

    <6>[ 109.509415] wlcore: IRQ work
    <7>[ 109.509421] wlcore_sdio: READ from 0x50f8
    <7>[ 109.509425] wlcore_sdio: READ 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509429] wlcore_sdio: READ 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509433] wlcore_sdio: READ 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509437] wlcore_sdio: READ 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509441] wlcore_sdio: READ 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509445] wlcore_sdio: READ 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509450] wlcore_sdio: READ 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509454] wlcore_sdio: READ 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509458] wlcore_sdio: READ 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509462] wlcore_sdio: READ 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509466] wlcore_sdio: READ 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509470] wlcore_sdio: READ 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509474] wlcore_sdio: READ 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509478] wlcore_sdio: READ 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    <7>[ 109.509482] wlcore_sdio: READ 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00
    <6>[ 109.509498] wlcore: mac80211 bss info role 0 changed 0xe
    <6>[ 109.509524] wlcore: intr: 0x4 (fw_rx_counter = 0, drv_rx_counter = 0, tx_results_counter = 0)
    <6>[ 109.509529] wlcore: WL1271_ACX_INTR_EVENT_A
  • Hi Steve,

    1) Regarding Interrupts:
    ======================

    When the modules are loaded do a “cat /proc/interrupts” and confirm that the numbers of wl18xx interrupts is “0”
    Next do an “ifconfig wlan0 up” and let the firmware load.
    Now check the number of interrupts. They should be “1”. (only one interrupt sent by the firmware when it booted).

    If you see a large number of interrupts or “0”, something is probably wrong.


    2) Regarding the driver code:
    =========================

    The drivers in the mainline linux kernel would not be the latest. Please use compat-wireless build to build the wl18xx modules. The latest wl18xx release is R8.5. Please see the release page at: software-dl.ti.com/.../index_FDS.html and the build instructions at: processors.wiki.ti.com/.../WL18xx_System_Build_Scripts

    Also, please note that the latest release is on kernel v 3.12. We don't yet have a 3.18 version. Hopefully the next version (R8.6 planned for e/o June) will be on 3.18.

    You might still be able to make it work on 3.18 but you will have to modify the release...

    Regards,
    Gigi Joseph.
  • 1) Thanks for the information on the expected number of interrupts.

    I was seeing 34 interrupts occur.  After poking around in the Baytrail pinctrl driver I saw that there is an interrupt flood limit where 32 interrupts cause the GPIO driver to disable interrupts.  I saw two interrupts handled by wlcore_irq, so it looks like I ran into the bug covered by this patch.

    With that patch in the build the chip wakes from ELP in ~26ms.

    2) I'm going to have to continue trying make this work on 3.18, it's either that or backport all the other changes I've been making for this Baytrail platform to 3.12

    Thanks!

  • Hi Steve,

    Thanks for the update... I will mark this as closed then.

    Regards,
    Gigi Joseph.