You are not logged in.

#1 2024-10-10 21:04:10

LumuBot
Member
Registered: 2024-10-10
Posts: 6

WiFi stops working after sleep, Authentication Supplicant Disconnected

Hello,
I am using KDE, NetworkManager, and iwd.

WiFi works as expected after booting, I can connect to both of my router's 2.4 and 5ghz networks.
After resuming from sleep, I get a notification (through KDE) about "Authentication Supplicant Disconnected", and connecting to any network fails. On doing so I get two more notifications, one saying that "No secrets were provided", and the other about deactivating the connection.

I tried switching to wpa_supplicant and I get a similar problem, but no notifications about auth supplicant or secrets

idk if this helps any, but here are the notifications, and linked is systemctl status for iwd/NetworkManager after boot, and after sleep
Network Management: Authorization Supplicant Disconnected
Network Management: Connection Deactivated; Network Management: No Secrets Provided

Offline

#2 2024-10-11 16:55:10

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

I am using KDE, NetworkManager, and iwd.

"and" or "with"?
Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

https://wiki.archlinux.org/title/Networ … Fi_backend

Offline

#3 2024-10-11 17:29:33

chinesegranny
Member
From: Russia, Saint-Petersburg
Registered: 2020-09-11
Posts: 15

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

I might have the same issue as you do. I believe there is an error with a WIFI driver (in my case iwlwifi), so I think I found a dirty fix for this problem, I didn't see your post and created a new one

Last edited by chinesegranny (2024-10-11 17:35:56)

Offline

#4 2024-10-11 18:59:09

LumuBot
Member
Registered: 2024-10-10
Posts: 6

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

seth wrote:

"and" or "with"

Im sorry, Im not entirely sure what the difference means in this context
I used iwctl while installing arch, so I made /etc/NetworkManager/conf.d/wifi_backend.conf and disabled iwd.service

Please post the output of...

dbus-org.freedesktop.nm-dispatcher.service | system
dbus-org.freedesktop.timesync1.service   | system
display-manager.service                  | system
getty@tty1.service                       | getty.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
systemd-timesyncd.service                | sysinit.target.wants
systemd-userdbd.socket                   | sockets.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants



chinesegranny wrote:

I believe there is some error with a WIFI driver (in my case iwlwifi)

Interesting, I am using an Intel AX210, but using an AMD cpu w/integrated graphics. Maybe you're facing two different issues?
Either way, reloading iwlwifi 'fixes' my problem, I made a service file to take care of this:

reload-iwlwifi.service


[Unit]
Description="Reloads iwlwifi upon wake from sleep"
After=sleep.target suspend.target

[Service]
Type=oneshot
ExecStart=/bin/rmmod iwlmvm
ExecStart=/bin/rmmod iwlwifi
ExecStart=/bin/modprobe iwlmvm
ExecStart=/bin/printf "iwlwifi reloaded"
TimeoutSec=0
StandardOutput=syslog

[Install]
WantedBy=multi-user.target sleep.target suspend.target

Offline

#5 2024-10-11 20:25:29

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

"I made /etc/NetworkManager/conf.d/wifi_backend.conf and disabled iwd.service" means "with", not "and" (that would have been concurrent use)

The iwlwifi reloading has been a thing in the past, in part because the rj45 connection acts as implicit rfkill that had NM or iwlwifi or both hiccup.
Though in your case I assume it's rather related to a module crash because of power saving features?
Do you only get aynting like https://bbs.archlinux.org/viewtopic.php?id=299851 ?

Offline

#6 2024-10-11 22:40:33

LumuBot
Member
Registered: 2024-10-10
Posts: 6

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

I dont have any connection instability, but disabling powersaving doesnt seem straightforward. (Im checking power management status with iwconfig)

Creating /etc/modprobe.d/iwlwifi.conf with options iwlwifi power_save=0 (and rebooting) shows power management on, and the issue persists
Creating  /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf  with wifi.powersave = 2 and rebooting, power management is on, issue persists
I can manually turn it off (iw dev wlan0 set power_save off), and iwconfig reflects the change, but the issue persists. Power management turns itself back on on the next boot, regardless if default-wifi-powersave-on.conf is present or not
Adding pcie_port_pm=off pcie_aspm.policy=performance to my kernel parameters dont seem to have an effect either

Offline

#7 2024-10-12 07:37:55

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

The module can control power saving strategies of the NIC (there's also an iwlmvm option) which is iwlwifi specific and different from the power setting by iw.
More interesting though is whether you get a similar crash/backtrace itfp.

Offline

#8 2024-10-13 18:33:02

LumuBot
Member
Registered: 2024-10-10
Posts: 6

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

Ah, well Im getting similar looking trace, Im seeing CSR_GP_CNTRL 0x0c040008 whereas the linked thread had CSR_GP_CNTRL 0xffffffff

Here is just the stacktrace, and the entire journalct -bl for this session

(also here's a journalctl -b w/out any iwlwifi.conf, default-wifi-powersave-on.conf or either kernel parameters. They look more or less the same to my untrained eye)

Offline

#9 2024-10-13 18:53:08

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

Oct 13 13:48:46 laptop kernel:  iwl_mvm_fast_resume+0x98/0x13d [iwlmvm 1400000003000000474e550021cb7691e0a93687]
Oct 13 13:48:46 laptop kernel:  __iwl_mvm_mac_start+0xd8/0x2a0 [iwlmvm 1400000003000000474e550021cb7691e0a93687]

With the stack trace, "iwlmvm.power_scheme=1" seems the most likely relevant parameter.

Offline

#10 2024-10-14 05:17:07

LumuBot
Member
Registered: 2024-10-10
Posts: 6

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

All three settings seem to have the same/similar issue

Status of configs:
    no pcie_port_pm=off pcie_aspm.policy=performance parameters
    no default_wifi_powersave_on.conf
    made a /etc/modprobe.d/intel_wifi.conf containing:

options iwlwifi power_save=false remove_when_gone=true
options iwlmvm power_scheme=1

Trace and full log for 1/active
Trace and full log for 2/balanced (which ought to be the basically the same as from before)
Trace and full log for 3/low power

Offline

#11 2024-10-14 07:11:40

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

You can check "systool -vm iwlmvm" to see whether the parameter was applied, but

Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Start IWL Error Log Dump:
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Transport status: 0x00000042, valid: 6
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Loaded firmware version: 89.202a2f7b.0 ty-a0-gf-a0-89.ucode
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000087 | ADVANCED_SYSASSERT          
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | trm_hw_status0
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | trm_hw_status1
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | branchlink2
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | interruptlink1
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | interruptlink2
…
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: timeout waiting for FW reset ACK (inta_hw=0x0)
…
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Failed to start RT ucode: -110
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: WRT: Collecting data: ini trigger 13 fired (delay=0ms).
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Start IWL Error Log Dump:
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Transport status: 0x0000004A, valid: 6
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: Loaded firmware version: 89.202a2f7b.0 ty-a0-gf-a0-89.ucode
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000084 | NMI_INTERRUPT_UNKNOWN       
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x002002F0 | trm_hw_status0
Oct 13 13:48:45 laptop kernel: iwlwifi 0000:02:00.0: 0x00000000 | trm_hw_status1
…
Oct 13 13:48:45 laptop kernel: Hardware became unavailable upon resume. This could be a software issue prior to suspend or a hardware issue.

the firmware crashes during the wakeup, this will have caused everything else.

https://www.linux.org/threads/iwlwifi-e … _os.50497/ (is not actually solved)
https://bbs.archlinux.org/viewtopic.php?id=292928 (similar crash but during the boot and wit older firmware)
https://askubuntu.com/questions/1521574 … -down-ubun (very similar condition, also unresolved)

So it's likely less a power saving feature but simply that the chip hasn't fully powered up when being accessed after the sleep and that results in a firmware crash and that causes the module errors.
Module juggling aside, if "remove_when_gone=true" can help you need to "gone" the chip, ie. rfkill it (around the sleep)

Offline

#12 2024-10-16 16:48:00

LumuBot
Member
Registered: 2024-10-10
Posts: 6

Re: WiFi stops working after sleep, Authentication Supplicant Disconnected

Ok, I think this is probably about as solved as im going to get for now:

I have implemented rfkill around sleep, works great. (avoids wlan0 becoming wlan1, 2, 3... after each sleep. Not a big deal but was kinda annoying)
Idk of a kosher/elegant method, but this is the script that handles the blocking/unblocking:

/usr/lib/systemd/system-sleep/kill-wifi.sh


#!/bin/sh

# Kill wireless NIC at suspend to avoid kernel attempting to access hardware before it has finished waking
if [ "${1}" == "pre" ]; then
  # Bring down wlan before sleep:
  /bin/printf "Killing wireless"
  /bin/rfkill block wlan
elif [ "${1}" == "post" ]; then
  # Bring up wlan after sleep
  /bin/printf "Onboarding wireless"
  /bin/rfkill unblock wlan
fi

I also removed the modprobe.d configs, as I dont think they were helping me.

Offline

Board footer

Powered by FluxBB