Bug 202563 - MT7630E after the computer is turn to "sleep mode": unable to reconnect to Wifi network
Summary: MT7630E after the computer is turn to "sleep mode": unable to reconnect to Wi...
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: networking_wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-11 20:44 UTC by Julien Deniau
Modified: 2019-02-20 06:23 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.20.6
Tree: Mainline
Regression: No


Attachments
0001-mt76x0e-add-pm-support.patch (5.94 KB, patch)
2019-02-18 13:48 UTC, Lorenzo Bianconi
Details | Diff
0002-mt76x0e-add-pm-support.patch (6.46 KB, patch)
2019-02-18 22:15 UTC, Lorenzo Bianconi
Details | Diff

Description Julien Deniau 2019-02-11 20:44:28 UTC
When the computer goes into sleep mode, and wakes up, the Wifi is unable to reconnect.


Distribution: Fedora 29 x86_64 with kernel 4.20.6

Output of `cat /proc/modules | grep mt76x`
mt76x0e 20480 0 - Live 0xffffffffc0c85000
mt76x0_common 81920 1 mt76x0e, Live 0xffffffffc0f93000
mt76x02_lib 57344 2 mt76x0e,mt76x0_common, Live 0xffffffffc0ff2000
mt76 45056 3 mt76x0e,mt76x0_common,mt76x02_lib, Live 0xffffffffc0fd5000
mac80211 933888 4 mt76x0e,mt76x0_common,mt76x02_lib,mt76, Live 0xffffffffc0eae000
cfg80211 770048 2 mt76x02_lib,mac80211, Live 0xffffffffc0cde000

Output of `lspci -vvv | grep mt76x`
04:00.0 Network controller: MEDIATEK Corp. MT7630e 802.11bgn Wireless Network Adapter
	DeviceName: WLAN
	Subsystem: Hewlett-Packard Company Device 197c
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 18
	Region 0: Memory at b0600000 (32-bit, non-prefetchable) [size=1M]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [70] Express (v2) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10.000W
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 unlimited
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
			ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s (ok), Width x1 (ok)
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+, OBFF Via message/WAKE#
			 AtomicOpsCap: 32bit- 64bit- 128bitCAS-
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+, OBFF Disabled
			 AtomicOpsCtl: ReqEn-
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
		AERCap:	First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 00000000 00000000 00000000 00000000
	Capabilities: [140 v1] Device Serial Number 00-00-06-7c-56-d4-4d-fc
	Capabilities: [150 v1] Latency Tolerance Reporting
		Max snoop latency: 71680ns
		Max no snoop latency: 71680ns
	Kernel driver in use: mt76x0e
	Kernel modules: mt76x0e



Output of `ifconfig` BEFORE going to sleep mode:
wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.94  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 2001:41d0:fc66:6f00:984f:9570:4bd2:3b15  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::bb46:a648:40ba:89b0  prefixlen 64  scopeid 0x20<link>
        ether fc:4d:d4:56:7c:06  txqueuelen 1000  (Ethernet)
        RX packets 301315  bytes 436715996 (416.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 154996  bytes 14576768 (13.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



Output of `ifconfig` AFTER going to sleep mode:
wlo1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 6a:cd:60:ae:a9:d4  txqueuelen 1000  (Ethernet)
        RX packets 510  bytes 562556 (549.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 400  bytes 51984 (50.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(it seems that the wlo1 interface is not "RUNNING" anymore)

output of `journalctl -xe` after waking up:
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2666] policy: auto-activating connection 'rogden 1' (6a086207-a1f8-4aa5-8025-5e7f48f4c689)
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2684] device (wlo1): Activation: starting connection 'rogden 1' (6a086207-a1f8-4aa5-8025-5e7f48f4c689)
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2686] device (wlo1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2698] manager: NetworkManager state is now CONNECTING
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2710] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2718] device (wlo1): Activation: (wifi) access point 'rogden 1' has security, but secrets are required.
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2718] device (wlo1): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2752] device (wlo1): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2757] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] device (wlo1): Activation: (wifi) connection 'rogden 1' has security, and secrets exist.  No new secrets needed.
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] Config: added 'ssid' value 'rogden'
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] Config: added 'scan_ssid' value '1'
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] Config: added 'bgscan' value 'simple:30:-80:86400'
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256'
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2761] Config: added 'psk' value '<hidden>'
févr. 11 21:36:07 jdeniau-fedora NetworkManager[1057]: <info>  [1549917367.2898] device (wlo1): supplicant interface state: ready -> scanning
févr. 11 21:36:08 jdeniau-fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
févr. 11 21:36:09 jdeniau-fedora audit[5933]: USER_AUTH pid=5933 uid=1000 auid=1000 ses=3 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=jdeniau-fedora addr=? terminal=pts/1 res=success'
févr. 11 21:36:09 jdeniau-fedora audit[5933]: USER_ACCT pid=5933 uid=1000 auid=1000 ses=3 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/su" hostname=jdeniau-fedora addr=? terminal=pts/1 res>
févr. 11 21:36:09 jdeniau-fedora su[5933]: (to root) jdeniau on pts/1
févr. 11 21:36:09 jdeniau-fedora audit[5933]: CRED_ACQ pid=5933 uid=1000 auid=1000 ses=3 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=jdeniau-fedora addr=? terminal=pts/1 res=success'
févr. 11 21:36:09 jdeniau-fedora su[5933]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice
févr. 11 21:36:09 jdeniau-fedora su[5933]: pam_unix(su-l:session): session opened for user root by (uid=1000)
févr. 11 21:36:09 jdeniau-fedora audit[5933]: USER_START pid=5933 uid=1000 auid=1000 ses=3 msg='op=PAM:session_open grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/su" hostname=jden>
févr. 11 21:36:10 jdeniau-fedora polkitd[1032]: Registered Authentication Agent for unix-process:5959:216794 (system bus name :1.594 [flatpak --installations], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, loc>
févr. 11 21:36:10 jdeniau-fedora polkitd[1032]: Unregistered Authentication Agent for unix-process:5959:216794 (system bus name :1.594, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (discon>
févr. 11 21:36:30 jdeniau-fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <warn>  [1549917392.0896] device (wlo1): Activation: (wifi) association took too long, failing activation
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.0897] device (wlo1): state change: config -> failed (reason 'ssid-not-found', sys-iface-state: 'managed')
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.0907] manager: NetworkManager state is now CONNECTED_LOCAL
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <warn>  [1549917392.0919] device (wlo1): Activation: failed for connection 'rogden 1'
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.0924] device (wlo1): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
févr. 11 21:36:32 jdeniau-fedora kernel: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
févr. 11 21:36:32 jdeniau-fedora gnome-shell[1781]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 11 21:36:32 jdeniau-fedora gnome-shell[1781]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 11 21:36:32 jdeniau-fedora gnome-shell[1781]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 11 21:36:32 jdeniau-fedora kernel: mt76x0e 0000:04:00.0: TX DMA did not stop
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.4888] device (wlo1): set-hw-addr: set MAC address to D2:99:B5:00:FF:74 (scanning)
févr. 11 21:36:32 jdeniau-fedora kernel: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.6938] device (wlo1): supplicant interface state: scanning -> disconnected
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.6942] device (wlo1): supplicant interface state: disconnected -> disabled
févr. 11 21:36:32 jdeniau-fedora NetworkManager[1057]: <info>  [1549917392.7079] device (wlo1): supplicant interface state: disabled -> disconnected
févr. 11 21:36:36 jdeniau-fedora wpa_supplicant[1201]: wlo1: Reject scan trigger since one is already pending
Comment 1 Lorenzo Bianconi 2019-02-12 22:38:21 UTC
mt76x0e does not currently support suspend/resume. I will work on it soon
Comment 2 Julien Deniau 2019-02-13 06:44:28 UTC
Good to know.

Thank you!
Comment 3 Lorenzo Bianconi 2019-02-18 13:48:04 UTC
Created attachment 281179 [details]
0001-mt76x0e-add-pm-support.patch
Comment 4 Lorenzo Bianconi 2019-02-18 13:50:54 UTC
Could you please try attached patch? Please note it is just compiled and not tested since I have no mt7630e adapter
Comment 5 Julien Deniau 2019-02-18 20:47:27 UTC
Hi,

I got the following error when trying to compile : 

ERROR: "mt76_tx_free" [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0e.ko] undefined! 

I tried different things:
- Compiling the 5.0.0-rc7 kernel without the patch, it does work
- Compiling then the same kernel with the patch, I got this error
- Launching `make drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0e.ko` (but it should do the same thing if I understood corerctly), and got the same error.

I tried investigate in the pci.c file myself:
it does compile when I copy the missing methods from "../tx.c"`, but when I try to load the modules with "rmmod mt76x0e; insmod path/to/mt76x0e.ko", I got the following error: "Invalid module format".
Comment 6 Lorenzo Bianconi 2019-02-18 22:15:49 UTC
Created attachment 281199 [details]
0002-mt76x0e-add-pm-support.patch

I added missing EXPORT_SYMBOL_GPL for mt76_tx_free in 0002-mt76x0e-add-pm-support.patch
Comment 7 Julien Deniau 2019-02-19 19:27:53 UTC
Hi,

I recompiled the kernel with this patch.
The wifi does work on startup, but does not work after a sleep mode.

The result of `journaltcl -xe` is : 
févr. 19 20:20:00 jdeniau-fedora NetworkManager[1058]: <warn>  [1550604000.4062] device (wlo1): Activation: (wifi) association took too long, failing activation
févr. 19 20:20:00 jdeniau-fedora NetworkManager[1058]: <info>  [1550604000.4063] device (wlo1): state change: config -> failed (reason 'ssid-not-found', sys-iface-state: 'managed')
févr. 19 20:20:00 jdeniau-fedora NetworkManager[1058]: <info>  [1550604000.4068] manager: NetworkManager state is now CONNECTED_GLOBAL
févr. 19 20:20:00 jdeniau-fedora NetworkManager[1058]: <warn>  [1550604000.4077] device (wlo1): Activation: failed for connection 'rogden 1'
févr. 19 20:20:00 jdeniau-fedora NetworkManager[1058]: <info>  [1550604000.4081] device (wlo1): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
févr. 19 20:20:00 jdeniau-fedora gnome-shell[1744]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 19 20:20:00 jdeniau-fedora gnome-shell[1744]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 19 20:20:00 jdeniau-fedora gnome-shell[1744]: An active wireless connection, in infrastructure mode, involves no access point?
févr. 19 20:20:01 jdeniau-fedora kernel:  0000:04:00.0: TX DMA did not stop
févr. 19 20:20:01 jdeniau-fedora kernel: mt76x0e 0000:04:00.0: Warning: MAC RX did not stop!
févr. 19 20:20:01 jdeniau-fedora kernel: mt76x0e 0000:04:00.0: TX DMA did not stop
févr. 19 20:20:01 jdeniau-fedora NetworkManager[1058]: <info>  [1550604001.8232] device (wlo1): set-hw-addr: set MAC address to 1A:76:18:BF:8A:D1 (scanning)
févr. 19 20:20:02 jdeniau-fedora NetworkManager[1058]: <info>  [1550604002.0326] device (wlo1): supplicant interface state: scanning -> disconnected
févr. 19 20:20:02 jdeniau-fedora NetworkManager[1058]: <info>  [1550604002.0345] device (wlo1): supplicant interface state: disconnected -> disabled
févr. 19 20:20:02 jdeniau-fedora NetworkManager[1058]: <info>  [1550604002.0507] device (wlo1): supplicant interface state: disabled -> disconnected


And `ifconfig`: 
wlo1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 1a:76:18:bf:8a:d1  txqueuelen 1000  (Ethernet)
        RX packets 3262  bytes 3113328 (2.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2723  bytes 1125153 (1.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Apparently, the message is slighty different this time, but is there a way to be sure that the patch is applied ? (I never compiled a kernel before, especially with a patch applied ! (but I use git on a daily basis so no problem about that))
Comment 8 Lorenzo Bianconi 2019-02-19 22:41:18 UTC
you can do:
- git am <patch>
- make
- make modules_install
- make install
Comment 9 Julien Deniau 2019-02-20 06:23:18 UTC
OK, that's what I did.

Note You need to log in before you can comment on or make changes to this bug.