Skip to contentSkip to conversation

WiFi interface stuck in 'Powered off' (link down) mode after suspend

DISCUSSION Toke Høiland-Jørgensen <toke at toke.dk> 2 participants 2 messages Apr 25, 2022 – Apr 28, 2022

lore
Share & tools
lore

Toke Høiland-Jørgensen <toke at toke.dk>

#0 lore raw

Hi everyone

I am encountering a strange problem with my WiFi not coming back after a suspend. Specifically, after a suspend-resume cycle, iwd will report, when issuing a 'station list' in iwctl:

No devices in Station mode available.

But when issuing a 'device list' it shows up:

wlan0 7a:e2:f0:31:a5:ae off phy0 station

which is a bit confusing, IMO. Issuing a 'device wlan0 show' gets me:

            Name                wlan0
            Mode                station
            Powered             off
            Address             7a:e2:f0:31:a5:ae
            Adapter             phy0                                           

And issuing a 'device wlan0 set-property Powered on' restores the device to working order and reconnects.

I went looking in the iwd source code, and it looks like that 'Powered' in iwd lingo translates to 'link up' in the kernel, right? Indeed, issuing an 'ip link up' on the wlan device after coming back from suspend is enough to get me back online.

I'm honestly not really sure if this is a bug in the kernel, or in iwd. I mean, it seems like iwd should be able to just set 'link up' and continue on its merry way (and indeed if I restart iwd entirely it will do this). But am also fairly sure it used to work on previous kernels, so maybe the kernel behaviour changed? (I have not had a chance to test this as bisecting is a bit cumbersome on my daily driver laptop; so figured I'd ask y'all's opinion first).

This happens on a 5.17 kernel with an Intel AX201 device (using the iwlwifi) driver.

Hoping someone can help me get this fixed, whether that be by fixing iwd or telling me to go bisect the kernel :)

-Toke

#1 lore raw

Hi Toke,

Quoted 2 lines · Toke Høiland-Jørgensen

Hi everyone

This message somehow went into spam, so only seeing this now.

Quoted 11 lines

I am encountering a strange problem with my WiFi not coming back after a suspend. Specifically, after a suspend-resume cycle, iwd will report, when issuing a 'station list' in iwctl:

No devices in Station mode available.

But when issuing a 'device list' it shows up:

wlan0 7a:e2:f0:31:a5:ae off phy0 station

which is a bit confusing, IMO. Issuing a 'device wlan0 show' gets me:

iwctl just shows the available 'Station' interfaces. iwd removes the station interfaces when the device is powered off (there's nothing to show). 'device list' shows the Device interfaces which correspond to the actual netdev. That is why you're seeing wlan0 in 'device list' but not in 'station list'

Quoted 9 lines
             Name                wlan0
             Mode                station
             Powered             off
             Address             7a:e2:f0:31:a5:ae
             Adapter             phy0

And issuing a 'device wlan0 set-property Powered on' restores the device to working order and reconnects.

iwd doesn't do anything on suspend, it isn't even aware of suspend. This looks like a kernel bug to me? Is the driver crashing by any chance?

Quoted 5 lines

I went looking in the iwd source code, and it looks like that 'Powered' in iwd lingo translates to 'link up' in the kernel, right? Indeed, issuing an 'ip link up' on the wlan device after coming back from suspend is enough to get me back online.

Device.Powered means IFF_UP, yes. But as I said above, this shouldn't be necessary if the kernel driver is doing the right thing...

Quoted 9 lines

I'm honestly not really sure if this is a bug in the kernel, or in iwd. I mean, it seems like iwd should be able to just set 'link up' and continue on its merry way (and indeed if I restart iwd entirely it will do this). But am also fairly sure it used to work on previous kernels, so maybe the kernel behaviour changed? (I have not had a chance to test this as bisecting is a bit cumbersome on my daily driver laptop; so figured I'd ask y'all's opinion first).

Quoted 6 lines

This happens on a 5.17 kernel with an Intel AX201 device (using the iwlwifi) driver.

Hoping someone can help me get this fixed, whether that be by fixing iwd or telling me to go bisect the kernel :)

There have been no iwd changes in this area in quite some time, so if the kernel is the only thing that changed, then I would look there.

Regards,
-Denis