I have an issue where upon closing the lid of my laptop (defined behaviour is to suspend), my wifi will break entirely. I've tried on both Arch and Ubuntu and the same issue occurs. I have tried restarting NetworkManager to no avail. It appears the wireless interface is being set to the DOWN state, but nothing seems to be able to bring it back up, without a reboot.
Using Ubuntu 21.04.
Huawei Matebook 2020 (Ryzen 4500U)
output of sudo lshw -c network
:
*-network
description: Wireless interface
product: RTL8822CE 802.11ac PCIe Wireless Network Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: wlp1s0
version: 00
serial: 80:30:49:37:ce:cf
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtw_8822ce driverversion=5.11.0-37-generic firmware=N/A ip=138.38.187.118 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:69 ioport:2000(size=256) memory:d0500000-d050ffff
UPDATE: For the entirety of yesterday, the wifi worked as expected (i.e. reconnecting quickly after a suspend), however today it has gone back to the usual issue. I can't think of anything I changed so this is hard to pin down.
UPDATE #2: I've tried a workaround by placing a script inside \lib\systemd\system-sleep
which runs as root:
#!/bin/sh
case $1 in
post)
ifconfig wlp1s0 up
;;
esac
And this worked momentarily, however upon the second time I woke my laptop, it stopped. Manually entering the command from the script results in the error:
SIOCSIFFLAGS: Operation already in progress
.
Note that this error doesn't occur if the wifi is working and I manually set the interface down and then up again, which signals to me that the script is hanging on this command after resume.