Score:0

Wifi breaks after laptop lid close / suspend

in flag

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.

cn flag
"tweaks"."suspend when lid is closed" turn it off and try if that keep wifi active.
e god avatar
in flag
nope, no effect
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.