You are not logged in.

#1 2018-02-14 16:13:44

WangYilin
Member
From: Beijing
Registered: 2016-12-15
Posts: 8

USB-wifi does not work after resuming from hibernation.

Hello everybody:
My USB-wifi does not work after resuming from hibernation, unless it is unpluged and repluged.

After resuming, I used lsusb and the wifi device was listed:

Bus 001 Device 005: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter

However I cannot access internet. Then I used netctl to restart my profile, it failed and suggested than I should use "systemd status" and "journalctl" to find details
Then I ran "systemd status netctl@220.service", the related results are as below:

systemd status netctl@220.service,
...
Feb 14 23:23:21 archlinux systemd[1]: Starting Automatically generated profile by wifi-menu...
Feb 14 23:23:21 archlinux network[4672]: Starting network profile '220'...
Feb 14 23:23:21 archlinux network[4672]: Could not set interface wlp0s20f0u8 flags (UP): No such device
Feb 14 23:23:21 archlinux network[4672]: WEXT: Could not set interface 'wlp0s20f0u8' UP
Feb 14 23:23:21 archlinux network[4672]: wlp0s20f0u8: Failed to initialize driver interface
Feb 14 23:23:22 archlinux network[4672]: The WPA supplicant did not start for interface 'wlp0s20f0u8'
Feb 14 23:23:22 archlinux network[4672]: Failed to bring the network up for profile '220'
Feb 14 23:23:22 archlinux systemd[1]: netctl@220.service: Main process exited, code=exited, status=1/FAILURE
Feb 14 23:23:22 archlinux systemd[1]: netctl@220.service: Failed with result 'exit-code'.
...

the related results of "journalctl -xe" are as follows(23:19:05-hibernated, 23:19:43-wakeup):

journalctl -xe"
...
Feb 14 23:19:05 archlinux systemd[1]: Reached target Sleep.
-- Subject: Unit sleep.target has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit sleep.target has finished starting up.
-- 
-- The start-up result is RESULT.
Feb 14 23:19:05 archlinux systemd[1]: Starting Hibernate...
-- Subject: Unit systemd-hibernate.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-hibernate.service has begun starting up.
Feb 14 23:19:05 archlinux systemd-sleep[4409]: Suspending system...
-- Subject: System sleep state hibernate entered
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The system has now entered the hibernate sleep state.
Feb 14 23:19:05 archlinux kernel: PM: hibernation entry
Feb 14 23:19:05 archlinux kernel: PM: Syncing filesystems ... 
Feb 14 23:19:43 archlinux kernel: PM: done.
Feb 14 23:19:43 archlinux kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Feb 14 23:19:43 archlinux kernel: OOM killer disabled.
...
Feb 14 23:19:43 archlinux kernel: Suspending console(s) (use no_console_suspend to debug)
Feb 14 23:19:43 archlinux kernel: r8712u 1-8:1.0 wlp0s20f0u8: Suspending...
Feb 14 23:19:43 archlinux kernel: serial 00:03: disabled
Feb 14 23:19:43 archlinux kernel: parport_pc 00:01: disabled
Feb 14 23:19:43 archlinux kernel: ACPI: Preparing to enter system sleep state S4
Feb 14 23:19:43 archlinux kernel: PM: Saving platform NVS memory
Feb 14 23:19:43 archlinux kernel: Disabling non-boot CPUs ...
...
Feb 14 23:19:43 archlinux kernel: Enabling non-boot CPUs ...
Feb 14 23:19:43 archlinux kernel: x86: Booting SMP configuration:
Feb 14 23:19:43 archlinux kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
Feb 14 23:19:43 archlinux kernel:  cache: parent cpu1 should not be sleeping
...
Feb 14 23:19:43 archlinux kernel: ACPI: Waking up from system sleep state S4
Feb 14 23:19:43 archlinux kernel: usb usb1: root hub lost power or was reset
Feb 14 23:19:43 archlinux kernel: usb usb2: root hub lost power or was reset
Feb 14 23:19:43 archlinux kernel: parport_pc 00:01: activated
Feb 14 23:19:43 archlinux kernel: serial 00:03: activated
Feb 14 23:19:43 archlinux kernel: sd 1:0:0:0: [sda] Starting disk
Feb 14 23:19:43 archlinux kernel: sd 3:0:0:0: [sdb] Starting disk
Feb 14 23:19:43 archlinux kernel: sd 5:0:0:0: [sdc] Starting disk
...
Feb 14 23:19:43 archlinux kernel: usb 1-12: reset full-speed USB device number 3 using xhci_hcd
Feb 14 23:19:43 archlinux kernel: ata2.00: configured for UDMA/133
Feb 14 23:19:43 archlinux kernel: ata4.00: configured for UDMA/133
Feb 14 23:19:43 archlinux kernel: usb 1-8: reset high-speed USB device number 5 using xhci_hcd
...
Feb 14 23:19:43 archlinux kernel: PM: hibernation exit
Feb 14 23:19:43 archlinux dhcpcd[4353]: wlp0s20f0u8: carrier lost
Feb 14 23:19:43 archlinux systemd-sleep[4409]: System resumed.
-- Subject: System sleep state hibernate left
...
Feb 14 23:19:43 archlinux systemd-logind[466]: Operation 'sleep' finished.
Feb 14 23:19:43 archlinux dhcpcd[4353]: wlp0s20f0u8: deleting default route via 192.168.1.1
Feb 14 23:19:43 archlinux dhcpcd[4353]: wlp0s20f0u8: deleting route to 192.168.1.0/24
Feb 14 23:21:09 archlinux polkitd[1024]: Registered Authentication Agent for unix-process:4540:2563840 (system bus name :1.1472 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
...
[systemctl restart netctl@220.service] (owned by unix-user:yilin)
Feb 14 23:22:21 archlinux systemd[1]: Stopping Automatically generated profile by wifi-menu...
-- Subject: Unit netctl@220.service has begun shutting down
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit netctl@220.service has begun shutting down.
Feb 14 23:22:21 archlinux network[4599]: Stopping network profile '220'...
Feb 14 23:22:21 archlinux dhcpcd[4604]: sending signal TERM to pid 4353
Feb 14 23:22:21 archlinux dhcpcd[4604]: waiting for pid 4353 to exit
Feb 14 23:22:21 archlinux dhcpcd[4353]: received SIGTERM, stopping
Feb 14 23:22:21 archlinux dhcpcd[4353]: wlp0s20f0u8: removing interface
Feb 14 23:22:21 archlinux dhcpcd[4353]: dhcpcd exited
Feb 14 23:22:21 archlinux network[4599]: Stopped network profile '220'
Feb 14 23:22:21 archlinux systemd[1]: Stopped Automatically generated profile by wifi-menu.
-- Subject: Unit netctl@220.service has finished shutting down
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit netctl@220.service has finished shutting down.
Feb 14 23:22:21 archlinux systemd[1]: Starting Automatically generated profile by wifi-menu...
-- Subject: Unit netctl@220.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit netctl@220.service has begun starting up.
Feb 14 23:22:21 archlinux network[4617]: Starting network profile '220'...
Feb 14 23:22:21 archlinux network[4617]: Could not set interface wlp0s20f0u8 flags (UP): No such device
Feb 14 23:22:21 archlinux network[4617]: WEXT: Could not set interface 'wlp0s20f0u8' UP
Feb 14 23:22:21 archlinux network[4617]: wlp0s20f0u8: Failed to initialize driver interface
Feb 14 23:22:22 archlinux network[4617]: The WPA supplicant did not start for interface 'wlp0s20f0u8'
Feb 14 23:22:22 archlinux network[4617]: Failed to bring the network up for profile '220'
Feb 14 23:22:22 archlinux systemd[1]: netctl@220.service: Main process exited, code=exited, status=1/FAILURE
Feb 14 23:22:22 archlinux systemd[1]: netctl@220.service: Failed with result 'exit-code'.
Feb 14 23:22:22 archlinux systemd[1]: Failed to start Automatically generated profile by wifi-menu.
-- Subject: Unit netctl@220.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit netctl@220.service has failed.

Could anyone help?
Thank you!

Offline

#2 2018-02-14 23:24:00

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: USB-wifi does not work after resuming from hibernation.

Feb 14 23:19:43 archlinux dhcpcd[4353]: wlp0s20f0u8: carrier lost

Hooks in /usr/lib/systemd/systemd-sleep to reload the rtl8****** module (check lsmod) might do, in doubt you'll have to rebind the usb port, https://zedt.eu/tech/linux/restarting-u … em-centos/

Offline

#3 2018-02-15 14:54:15

WangYilin
Member
From: Beijing
Registered: 2016-12-15
Posts: 8

Re: USB-wifi does not work after resuming from hibernation.

Thank you! the problem has been resolved
Reloading the r8712u does not work. After the r8712u was reloaded, I used "ip link" to set r8712u up, resulting in a long time wait(which seems to last forever).
Rebinding the usb port according to https://zedt.eu/tech/linux/restarting-u … em-centos/ works well.
So I conbined your two suggestions by creating a script in /usr/lib/systemd/system-sleep which is as follows.

######/usr/lib/systemd/system-sleep/restart_usb_subsystem.sh######
#!/bin/sh
case $1/$2 in
	post/hibernate)
		echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
		echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/bind
		;;
esac
#"0000:00:14.0" is read from /sys/bus/pci/drivers/xhci_hcd/

Then the wifi profile can be started without errors after hibernation.
Thank you again!

Last edited by WangYilin (2018-03-07 11:21:58)

Offline

Board footer

Powered by FluxBB