Bug 203787
Summary: | iwlwifi: no wireless connection when on battery | ||
---|---|---|---|
Product: | Drivers | Reporter: | Jannis Vajen (jvajen) |
Component: | network-wireless | Assignee: | DO NOT USE - assign "network-wireless-intel" component instead (linuxwifi) |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | seth |
Priority: | P1 | ||
Hardware: | x86-64 | ||
OS: | Linux | ||
Kernel Version: | 5.1.5-050105-generic | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
trace-cmd record -e iwlwifi
output of lscpi in AC mode ouput of lspci in battery mode trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg debug patch trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg (debug) dmesg (modprobe -r iwlwifi) dmesg (boot in battery mode, modprobe -r iwlwifi, modprobe iwlwifi) |
Description
Jannis Vajen
2019-06-03 09:25:45 UTC
Can you please attach the output of sudo lspci -xxxxvvvv In AC and bat mode Thanks. Created attachment 283049 [details]
output of lscpi in AC mode
Created attachment 283051 [details]
ouput of lspci in battery mode
Thank you for looking into this, Emmanuel. Can you please record tracing but with the following flags: -e iwlwifi_dgb -e mac80211 -e cfg80211 -e iwlwifi ? Thanks. Created attachment 283055 [details]
trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg
`sudo trace-cmd record -e iwlwifi_dgb -e mac80211 -e cfg80211 -e iwlwifi` didn't work as I don't seem to have the iwlwifi_dbg module/file available.
I ran `sudo trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi` instead.
Please let me know if that works or if I need to provide more data.
Sorry, can you use: sudo trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg thanks. Created attachment 283059 [details]
trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg
Sure, here's the output with iwlwifi_msg. Thanks again for taking the time!
[007] 8129.890391: iwlwifi_dbg: iwl_pcie_irq_handler[U] -- Rx interrupt [002] 8134.836434: iwlwifi_err: Error sending STATISTICS_CMD: time out after 2000ms. No interrupt after 8129.890391 until the firmware crashes.... Can you please tell me when you switched to BAT mode? I am pretty sure that it is after 8129.890391. In this case, it'd mean that we don't get any interrupt in BAT mode which is not very healthy. Another weird thing: NetworkManager-1197 [002] 8130.806037: iwlwifi_dbg: iwl_pcie_send_hcmd_sync[U] -- Attempting to send sync command STATISTICS_CMD NetworkManager-1197 [002] 8130.806038: iwlwifi_dbg: iwl_pcie_send_hcmd_sync[U] -- Setting HCMD_ACTIVE for command STATISTICS_CMD NetworkManager-1197 [002] 8132.820393: iwlwifi_dbg: iwl_pcie_enqueue_hcmd[I] -- Sending command STATISTICS_CMD (01.9c), seq: 0x0015, 12 bytes at 21[21]:0 NetworkManager-1197 [002] 8132.820399: iwlwifi_dev_hcmd: STATISTICS_CMD (0x019c) / seq 0x15/sync/wantskb (12 bytes) NetworkManager-1197 [002] 8134.836434: iwlwifi_err: Error sending STATISTICS_CMD: time out after 2000ms. the diff in timings between iwl_pcie_send_hcmd_sync and iwl_pcie_enqueue_hcmd is ... 2 seconds!! This is absolutely insane. More work needed here to debug. I'll need to send you debug patches. Will you be able to apply them to test? You can take our backport driver if it's more convenient. Created attachment 283061 [details]
debug patch
Please reproduce with trace-cmd running as before with the patch attached.
Thanks!
Created attachment 283099 [details]
trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg (debug)
Thank you Emmanuel. I managed to apply the patch and ran another trace-cmd. This time I switched to battery mode around 315 and reverted to AC mode around the 399 mark.
Hm... 315 is not even in the tracing output Moreover I can see that this time, the two seconds delay in the command transmission didn't occur. Can you try to reload the iwlwifi module while in BAT mode? Just do: sudo modprobe -r iwlwifi sudo modprobe iwlwifi then, please send the dmesg output. Thanks. Forget my last request, unnecessary. What is the value of the d0i3_disable module parameter? cat /sys/module/iwlwifi/parameters/d0i3_disable Created attachment 283103 [details]
dmesg (modprobe -r iwlwifi)
cat /sys/module/iwlwifi/parameters/d0i3_disable
N
Very strange; I reloaded the iwlwifi module and I can use wireless in battery mode since. I will reboot and see if it's reproducible.
Created attachment 283105 [details]
dmesg (boot in battery mode, modprobe -r iwlwifi, modprobe iwlwifi)
I rebooted with the AC adapter being disconnected and didn't have wifi at first. At around 120seconds I reloaded the module and internet was working!
I believe it's all related to the d0i3 module parameter and runtime PM. Although I can't explain why reloading the module helps. Can you please set the module parameter to true in iwlwifi.conf under /etc/modprobe.d/ and see what happens. Have you installed the backport driver? Apparently, the default value differs between mainline kernel and our backport tree. Not very healthy. Disabling d0i3 in /etc/modprobe.d/iwlwifi.conf helps and makes wifi available directly after boot in battery mode. I didn't install the backport driver. Ok, then I guess I need to understand why d0i3_disable is not enabled by default. According to https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/wireless/intel/iwlwifi/iwl-drv.c?h=linux-5.1.y#n1670 It should be disabled by default... Can you please check what is the value of the IWLWIFI_PCIE_RTPM Kconfig option? $ grep CONFIG_IWLWIFI_PCIE_RTPM config-* config-5.0.0-13-generic:# CONFIG_IWLWIFI_PCIE_RTPM is not set config-5.0.0-15-generic:# CONFIG_IWLWIFI_PCIE_RTPM is not set config-5.1.5-050105-generic:# CONFIG_IWLWIFI_PCIE_RTPM is not set config-5.1.6:# CONFIG_IWLWIFI_PCIE_RTPM is not set config-5.1.6.old:# CONFIG_IWLWIFI_PCIE_RTPM is not set Ok thanks. In any case, I'd like to get a clear picture now. 1) Is it established that when d0i3 is disabled (module parameter is set), no bug? 2) when you don't set any value in /etc/modprobe/iwlwifi.conf, what default value for d0i3_disable module parameter do you get? Dear Emmanuel, I'm deeply sorry for overlooking this: in order to save power consumption I had copied a configuration from a blog post that enabled d0i3 (among other things). I now removed that line completely and there's no quirks anymore when switching to battery mode. Regarding your questions: 1) correct, when d0i3 is disabled there is no bug. 2) having removed the offending config line, everything is as it should be and d0i3_disable is at its default (Y). Again, I'm sorry for not seeing this earlier. Without your efforts I probably wouldn't have figured this out. No worries. Please let the blog owner know that he is suggesting a dangerous configuration that is not default for a reason. |