NIC unavailable after suspend to RAM

Bug #1931301 reported by Sebastian Schauenburg
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Chris Chiu
Hirsute
Fix Released
Medium
Chris Chiu

Bug Description

[SRU Justification]

[Impact]
The network card will be unavailable after system resume if the interface is not UP before suspend.

[Fix]
It's because we added the WOL support for this driver. The driver with WoL feature does detach the network interface even the interface is DOWN. However, it doesn't attach the network interface back on resume if it was DOWN. That's why it's unavailable after resume. Fix this by correctly netif_device_attach according to the interface status.

[Test Case]
1. Plug the ethernet cable to the Atheros E220x ethernet adapter
2. Suspend the system and check if the ethernet interface available after resume
3. Unplug the ethernet cable
4. Suspend the system and check if the ethernet interface available after resume

[Regression Potential]
Low. The driver code would be identical to working Groovy version after fix.

========== Original Bug Description ==========

Upgraded to 21.04 (hirsute) and now the network card is unavailable after suspend to RAM (sleep state S3). It worked flawlessly up until 20.10. My workaround for now is unloading and reloading the kernel module, but that won't work for normal users, hence this report.

NIC in its unavailable state:
  2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
      link/ether d0:50:99:27:02:11 brd ff:ff:ff:ff:ff:ff

NIC (from lspci):
  04:00.0 Ethernet controller: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller (rev 10)

Trying to ifconfig it down/up results in:
  SIOCSIFFLAGS: No such device

journalctl shows (right after recovering from suspend):
  NetworkManager[1911]: <info> [1623181236.9371] manager: sleep: wake requested (sleeping: yes enabled: yes)
  NetworkManager[1911]: <info> [1623181236.9372] device (enp4s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
  NetworkManager[1911]: <info> [1623181236.9382] manager: NetworkManager state is now CONNECTED_LOCAL

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: network-manager 1.30.0-1ubuntu3
ProcVersionSignature: Ubuntu 5.11.0-18.19-generic 5.11.17
Uname: Linux 5.11.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Tue Jun 8 21:59:15 2021
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2016-08-25 (1748 days ago)
InstallationMedia: Ubuntu-MATE 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
RfKill:

SourcePackage: network-manager
UpgradeStatus: Upgraded to hirsute on 2021-06-04 (4 days ago)
nmcli-nm:
 RUNNING VERSION STATE STARTUP CONNECTIVITY NETWORKING WIFI-HW WIFI WWAN-HW WWAN
 running 1.30.0 connected started full enabled enabled enabled enabled enabled

CVE References

Revision history for this message
Sebastian Schauenburg (sschauenburg) wrote :
Revision history for this message
captain-wifi (laukokpin) wrote :

I just upgraded from 20.10 to 21.04. This affects me too. network card is unavailable after waking from suspension.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Jan Muller (rattkin) wrote :

i did a fresh install of 21.04, not an upgrade.
the same problem.
Doesn't seem to be upgrade related.

Revision history for this message
Dan Streetman (ddstreet) wrote :

> Trying to ifconfig it down/up results in:
> SIOCSIFFLAGS: No such device

that likely means the kernel driver had some problem waking the device back up, but there's no dmesg attached to the bug so i don't know. This is probably a bug in the 'alx' kernel driver (or, problem with the hardware), not network-manager.

affects: network-manager (Ubuntu) → linux (Ubuntu)
Revision history for this message
Mike Holmes (mike-holmes) wrote :

I also tried a refresh install to fix this, and it did not help

mike@mike-XPS-8930:~$ lspci -nn | grep -i ethernet
04:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller [1969:e0a1] (rev 10)
mike@mike-XPS-8930:~$

Revision history for this message
Chris Chiu (mschiu77) wrote :

It might be caused by the patch https://github.com/torvalds/linux/commit/a4dcfbc4ee2218abd567d81d795082d8d4afcdf6 which is the only difference between 20.10 and 21.04 kernel.

I build a test hirsute kernel in https://people.canonical.com/~mschiu77/lp1931301/v1/, could you install and check if the problem still persists? Please also provide me the full dmesg log based on this kernel. Thanks.

Revision history for this message
Chris Chiu (mschiu77) wrote :

Thanks to @Sebastian for the dmesg output of original hirsute kernel and mine. I'll look into why the netif_running get false result during resume. Will build some customized kernel and still need your help for verification.

Revision history for this message
Chris Chiu (mschiu77) wrote :
Revision history for this message
Chris Chiu (mschiu77) wrote :

The cause is still unknown of why the interface is gone. Could you download and install the latest amd64/build generic deb files in https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.13/ (see section "How do I install an upstream kernel?" in https://wiki.ubuntu.com/Kernel/MainlineBuilds) and check if the ethernet is still gone after resume?

And also try my v2 kernel in https://people.canonical.com/~mschiu77/lp1931301/v2/ which I add some debug messages to address when/where the ethernet interface gone.

Please post full dmesg output for both kernels. Thanks

Revision history for this message
Sebastian Schauenburg (sschauenburg) wrote :

Did you change anything else in this kernel? Because it seemed to work correctly.

Revision history for this message
Sebastian Schauenburg (sschauenburg) wrote :

this went horribly wrong, since suspend itself did not work at all ;-)
( freezing of tasks failed after 20.010 seconds )

Revision history for this message
Chris Chiu (mschiu77) wrote :

I added some debug messages on my kernel to find out when/why the LINK_STATE_START been toggled off after resume which is not expected. I add more debug messages in https://people.canonical.com/~mschiu77/lp1931301/v3/. Could you help me verify this and post me the dmesg? Thanks.

Revision history for this message
Sebastian Schauenburg (sschauenburg) wrote :

Sure thing Chris, here's the dmesg log.
Before I forget: thank you for helping me out here, I really appreciate it.

Revision history for this message
Eric Heintzmann (ericheintzmann) wrote (last edit ):

I have the exact same issue with the "alx" module and Network Manager.
But it seems that reloading this module with the "wake on lan" option enabled resolves the problem (sudo modprobe alx enable_wol=on).

Revision history for this message
Chris Chiu (mschiu77) wrote :

Thanks for the information. Will propose a fix soon.

Chris Chiu (mschiu77)
Changed in linux (Ubuntu):
assignee: nobody → Chris Chiu (mschiu77)
Changed in linux (Ubuntu Hirsute):
assignee: nobody → Chris Chiu (mschiu77)
status: New → Confirmed
description: updated
Revision history for this message
John (jgwaclawsky) wrote :

I have the exact same problem using 21.04. After resume it says something about the network cable being unplugged in the settings menu under network wired. I have found rebooting is the fastest way (only way that I know that works) to get back running. My work around is to not suspend. Configuration information:

lshw -C network outpu (with the network running)

*-network
       description: Ethernet interface
       product: Killer E2400 Gigabit Ethernet Controller
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: enp4s0
       version: 10
       serial: 00:4e:01:ac:76:26
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=alx driverversion=5.11.0-25-generic duplex=full ip=192.168.1.25 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:19 memory:ec500000-ec53ffff ioport:d000(size=128)

Revision history for this message
Jonas Gamao (yamiyukisenpai) wrote :

Also experienced the same thing on KDE Neon Testing Edition (Ubuntu 20.04) with HWE-edge kernels & Pop!_OS kernels.

https://bugs.launchpad.net/ubuntu/+source/linux-hwe-edge/+bug/1938647

I have these kernels in my system right now, and only 5.11 is affected:
* 5.8.0-63-generic
* 5.11.0.25.27
* 5.11.0.7620.21

Revision history for this message
Jonas Gamao (yamiyukisenpai) wrote :

This is my network card:

  *-network
       description: Ethernet interface
       product: Killer E2400 Gigabit Ethernet Controller
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: enp6s0
       version: 10
       serial: d8:cb:8a:a3:f7:df
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=alx driverversion=5.8.0-63-generic duplex=full ip=192.168.100.13 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:19 memory:df100000-df13ffff ioport:d000(size=128)

Currently running on 5.8 to test and see if it's a 5.11 issue or just my network card, and I stumbled onto this after I reported it.

Revision history for this message
Javier Carrera (javonaso) wrote :

Same problem on ubuntu 21.04 here:

  *-network
       description: Ethernet interface
       product: QCA8171 Gigabit Ethernet
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:08:00.0
       logical name: enp8s0
       version: 10
       serial: 60:02:92:15:4f:ce
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=alx driverversion=5.11.0-25-generic duplex=full ip=192.168.0.101 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:18 memory:d1400000-d143ffff ioport:3000(size=128)

I also noticed blueman only remembers "Recent Connections" after a reboot. After suspending it forgets them and I have to enter "Bluetooth Devices" and connect through there. Not a serious issue and i'm not sure it's related but just in case.

Stefan Bader (smb)
Changed in linux (Ubuntu Hirsute):
importance: Undecided → Medium
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Changed in linux (Ubuntu Hirsute):
status: Confirmed → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-hirsute' to 'verification-done-hirsute'. If the problem still exists, change the tag 'verification-needed-hirsute' to 'verification-failed-hirsute'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-hirsute
Revision history for this message
Sebastian Schauenburg (sschauenburg) wrote :

Have tested the linux-image-5.11.0-33-generic:amd64 5.11.0-33.35 from proposed and I can verify it fixed the issue for me.

Switched back to the non-proposed 5.11.0-31 kernel and am looking forward to the new update.

tags: added: verification-done-hirsute
removed: verification-needed-hirsute
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (62.5 KiB)

This bug was fixed in the package linux - 5.11.0-34.36

---------------
linux (5.11.0-34.36) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-34.36 -proposed tracker (LP: #1941766)

  * Server boot failure after adding checks for ACPI IRQ override (LP: #1941657)
    - Revert "ACPI: resources: Add checks for ACPI IRQ override"

linux (5.11.0-33.35) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-33.35 -proposed tracker (LP: #1940101)

  * libvirtd fails to create VM (LP: #1940107)
    - sched: Stop PF_NO_SETAFFINITY from being inherited by various init system
      threads

linux (5.11.0-32.34) hirsute; urgency=medium

  * hirsute/linux: 5.11.0-32.34 -proposed tracker (LP: #1939769)

  * Packaging resync (LP: #1786013)
    - debian/dkms-versions -- update from kernel-versions (main/2021.08.16)

  * CVE-2021-3656
    - SAUCE: KVM: nSVM: always intercept VMLOAD/VMSAVE when nested

  * CVE-2021-3653
    - SAUCE: KVM: nSVM: avoid picking up unsupported bits from L2 in int_ctl

  * [regression] USB device is not detected during boot (LP: #1939638)
    - SAUCE: Revert "usb: core: reduce power-on-good delay time of root hub"

  * Support builtin revoked certificates (LP: #1932029)
    - [Packaging] build canonical-revoked-certs.pem from branch/arch certs
    - [Packaging] Revoke 2012 UEFI signing certificate as built-in
    - [Config] Configure CONFIG_SYSTEM_REVOCATION_KEYS with revoked keys

  * Support importing mokx keys into revocation list from the mok table
    (LP: #1928679)
    - SAUCE: integrity: add informational messages when revoking certs

  * Support importing mokx keys into revocation list from the mok table
    (LP: #1928679) // CVE-2020-26541 when certificates are revoked via
    MokListXRT.
    - SAUCE: integrity: Load mokx certs from the EFI MOK config table

  * Include product_sku info to modalias (LP: #1938143)
    - firmware/dmi: Include product_sku info to modalias

  * Fix Ethernet not working by hotplug - RTL8106E (LP: #1930645)
    - net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
    - SAUCE: r8169: Use PHY_POLL when RTL8106E enable ASPM

  * [SRU][H/OEM-5.10/OEM-5.13/U] Fix system hang after unplug tbt dock
    (LP: #1938689)
    - SAUCE: igc: fix page fault when thunderbolt is unplugged

  * [Regression] Audio card [8086:9d71] not detected after upgrade from linux
    5.4 to 5.8 (LP: #1915117)
    - [Config] set CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC to y

  * Backlight (screen brightness) on Lenovo P14s AMD Gen2 inop (LP: #1934557)
    - drm/amdgpu/display: only enable aux backlight control for OLED panels

  * Touchpad not working with ASUS TUF F15 (LP: #1937056)
    - pinctrl: tigerlake: Fix GPIO mapping for newer version of software

  * dev_forward_skb: do not scrub skb mark within the same name space
    (LP: #1935040)
    - dev_forward_skb: do not scrub skb mark within the same name space

  * Fix display output on HP hybrid GFX laptops (LP: #1936296)
    - drm/i915: Invoke another _DSM to enable MUX on HP Workstation laptops

  * [SRU][OEM-5.10/H] UBUNTU: SAUCE: Fix backlight control on Samsung 16727
    panel (LP: #1930527)
    - SAUCE: drm/i915: Force DPCD backlight mode for Samsung 16727 pa...

Changed in linux (Ubuntu Hirsute):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.