r8169 ethernet card don't work after returning from suspension

Bug #1752772 reported by Leonardo Müller on 2018-03-02
742
This bug affects 166 people
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
Unassigned
linux (Ubuntu)
Medium
Unassigned
Bionic
Undecided
Unassigned
linux-kernel-headers (Ubuntu)
Undecided
Unassigned

Bug Description

===SRU Justification===
[Impact]
Ethernet r8169 stops working after system resumed from suspend.

[Test]
User confirmed these patches fix the issue. r8169 continues to work
after resume from suspend.

[Regression Potential]
Medium. The fix is limited to one device, all patches are in mainline.
The WOL default change might cause regression for users that depend on
BIOS settings. We can advice them to use userspace tool (systemd,
ethtool, etc.) instead.

===Original Bug Report===
I have noticed that the network stopped working on my desktop after I've suspended the system and woke it up. On dmesg there are messages like:

[ 150.877998] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[ 150.944101] do_IRQ: 3.37 No irq handler for vector
[ 150.944105] r8169 0000:01:00.0 enp1s0: link down
[ 150.944180] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready

When using Xenial (from a different install), this problem is not happening. This is happening on Bionic.

There are only two ways to restore connectivity:
1) Reboot the system;
2) Remove the r8169 module and reinsert it with modprobe.

The motherboard is a AsRock H55M-LE and the Ethernet controller is:

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: linux-firmware 1.172
ProcVersionSignature: Ubuntu 4.15.0-10.11-generic 4.15.3
Uname: Linux 4.15.0-10-generic x86_64
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
CurrentDesktop: LXDE
Date: Fri Mar 2 00:21:57 2018
Dependencies:

InstallationDate: Installed on 2018-02-26 (3 days ago)
InstallationMedia: Lubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180226)
PackageArchitecture: all
SourcePackage: linux-firmware
UpgradeStatus: No upgrade log present (probably fresh install)
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.15.0-10-generic.
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: MID [HDA Intel MID], device 0: VT1818S Analog [VT1818S Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: usuario 1153 F.... pulseaudio
 /dev/snd/controlC1: usuario 1153 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'MID'/'HDA Intel MID at 0xfbdf8000 irq 26'
   Mixer name : 'VIA VT1818S'
   Components : 'HDA:11060440,18492818,00100000'
   Controls : 40
   Simple ctrls : 17
Card1.Amixer.info:
 Card hw:1 'HDMI'/'HDA ATI HDMI at 0xfbffc000 irq 27'
   Mixer name : 'ATI R6xx HDMI'
   Components : 'HDA:1002aa01,00aa0100,00100200'
   Controls : 7
   Simple ctrls : 1
Card1.Amixer.values:
 Simple mixer control 'IEC958',0
   Capabilities: pswitch pswitch-joined
   Playback channels: Mono
   Mono: Playback [on]
CurrentDesktop: LXDE
Dependencies:

DistroRelease: Ubuntu 18.04
HibernationDevice: RESUME=UUID=edd83175-c707-4b31-90d2-ce2f5cebc73f
InstallationDate: Installed on 2018-02-26 (3 days ago)
InstallationMedia: Lubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180226)
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
Package: linux-firmware 1.172
PackageArchitecture: all
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz root=UUID=0c4fc517-b7a0-49b0-bfcb-0485dfe6413b ro quiet
ProcVersionSignature: Ubuntu 4.15.0-10.11-generic 4.15.3
RelatedPackageVersions:
 linux-restricted-modules-4.15.0-10-generic N/A
 linux-backports-modules-4.15.0-10-generic N/A
 linux-firmware 1.172
RfKill:

Tags: bionic
Uname: Linux 4.15.0-10-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirt lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 10/20/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.80
dmi.board.name: H55M-LE
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.80:bd10/20/2010:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnH55M-LE:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To Be Filled By O.E.M.
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

CVE References

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1752772

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete

apport information

tags: added: apport-collected
description: updated

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
dino99 (9d9) wrote :

you might need to install both: r8168-dkms & libelf.dev (a r8168 report already exist on launchpad)

Joseph Salisbury (jsalisbury) wrote :

Did this issue start happening after an update/upgrade? Was there a prior kernel version where you were not having this particular problem?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.16 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16-rc4

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete

Using the 4.16-rc4 kernel have not made the network card work after suspension and, when I try to wake up the system it is remounting the file system as read only and I can't open Firefox, so I'm reporting from another computer now.

dino99's solution wouldn't break Secure Boot? Also, it works fine on 16.04, as I could suspend the system and it would wake up with no problems with that version.

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Kai-Heng Feng (kaihengfeng) wrote :

Please find the first bad -rc* kernel that has this issue.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/

The last version working properly is 4.15-rc4. 4.15-rc5 don't suspend (it fails to) and, starting from 4.15-rc6, this problem with the Ethernet card appears.

Kai-Heng Feng (kaihengfeng) wrote :

Do you still have this issue on v4.16-rc4?

Yes, with 4.16-rc4 and 4.16-rc5 the problem persists. Every kernel version after 4.15-rc5 is making the computer lose connectivity after returning from suspension.

Launchpad Janitor (janitor) wrote :

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

Changed in linux-firmware (Ubuntu):
status: New → Confirmed
Kai-Heng Feng (kaihengfeng) wrote :

Can you do a kernel bisection?

First, find the last good -rc kernel and the first bad -rc kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/

Then,
$ sudo apt build-dep linux
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux
$ git bisect start
$ git bisect good v4.15-rc4
$ git bisect bad v4.15-rc6
$ make localmodconfig
$ make -j`nproc` deb-pkg
Install the newly built kernel.
If the issue still happens,
$ git bisect bad
Otherwise,
$ git bisect good
Repeat to "make -j`nproc` deb-pkg" until you find the commit that causes the regression.

The kernels built using this procedure are not working properly. The screen is limited at 640x480 and, after suspending and trying to restore, the screen never turns on again, even trying to change to a tty don't work, so I can't test because I can't see anything.

Kai-Heng Feng (kaihengfeng) wrote :

Right, I have two desktops that have this card. Let me see if I can reproduce the issue on them.

no longer affects: linux-firmware (Ubuntu)
Kai-Heng Feng (kaihengfeng) wrote :

This is the bad commit:

commit bc976233a872c0f20f018fb1e89264a541584e25
Author: Thomas Gleixner <email address hidden>
Date: Fri Dec 29 10:47:22 2017 +0100

    genirq/msi, x86/vector: Prevent reservation mode for non maskable MSI

I'll report the issue to upstream maintainers.

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
elguavas (elguavas.) wrote :

just testing ubuntu 18.04 beta 2 and have this exact same problem. removing and reloading the r8169 module fixes the problem, but i think it's a serious bug if networking is completely lost on every system suspend...

most users will not troubleshoot enough or be able to unload/reload drivers, having networking completely fail after every suspend is more than medium severity for what is tyo be an lts release.

Kai-Heng Feng (kaihengfeng) wrote :

Can you try latest mainline kernel again? At least the issue is gone for me with latest mainline kernel.

I'll do a reverse bisect to find the commit that fixes the issue, and backport the patch to Bionic's kernel.

elguavas (elguavas.) wrote :

i just installed the latest mainline kernel available in the mainline ppa which was 4.16.1-041601-generic_4.16.1-041601.201804081334 and the problem is just the same.

Kai-Heng Feng (kaihengfeng) wrote :

Okay, can you use the patch [1] and attach dmesg after resume?

[1] https://lkml.org/lkml/2018/4/3/136

Download full text (4.7 KiB)

With a different install of Bionic in my notebook, the problem is happening too. This appears on dmesg:

[ 95.285073] ------------[ cut here ]------------
[ 95.285109] NETDEV WATCHDOG: enp1s0 (r8169): transmit queue 0 timed out
[ 95.285165] WARNING: CPU: 3 PID: 0 at /build/linux-5s7Xkn/linux-4.15.0/net/sched/sch_generic.c:323 dev_watchdog+0x221/0x230
[ 95.285170] Modules linked in: rfcomm ccm xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 bridge stp llc devlink ebtable_filter ebtables bnep binfmt_misc nls_iso8859_1 arc4 uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core videodev snd_soc_skl snd_soc_skl_ipc snd_hda_ext_core snd_soc_sst_dsp snd_soc_sst_ipc snd_soc_acpi snd_soc_core media snd_compress rtsx_usb_ms memstick btusb btrtl btbcm btintel bluetooth ecdh_generic snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic ac97_bus snd_pcm_dmaengine snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm ip6t_REJECT snd_seq_midi nf_reject_ipv6 snd_seq_midi_event xt_hl ip6t_rt ath10k_pci ath10k_core ath mac80211 cfg80211 snd_rawmidi snd_seq snd_seq_device snd_timer nf_conntrack_ipv6
[ 95.285324] nf_defrag_ipv6 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc input_leds aesni_intel aes_x86_64 crypto_simd glue_helper cryptd intel_cstate intel_rapl_perf joydev serio_raw intel_wmi_thunderbolt snd mei_me mei shpchp soundcore intel_pch_thermal ipt_REJECT nf_reject_ipv4 ideapad_laptop sparse_keymap xt_limit tpm_crb mac_hid acpi_pad xt_tcpudp xt_addrtype nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack ip6table_filter ip6_tables nf_conntrack_netbios_ns nf_conntrack_broadcast nf_nat_ftp nf_nat nf_conntrack_ftp nf_conntrack sch_fq_codel libcrc32c iptable_filter parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid rtsx_usb_sdmmc hid rtsx_usb uas usb_storage i915 i2c_algo_bit drm_kms_helper
[ 95.285473] syscopyarea sysfillrect sysimgblt fb_sys_fops ahci r8169 psmouse drm libahci mii wmi video
[ 95.285511] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.15.0-20-generic #21-Ubuntu
[ 95.285515] Hardware name: LENOVO 80UG/Toronto 4A2, BIOS 0XCN43WW 07/10/2017
[ 95.285531] RIP: 0010:dev_watchdog+0x221/0x230
[ 95.285542] RSP: 0018:ffff9158f3583e58 EFLAGS: 00010286
[ 95.285549] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[ 95.285554] RDX: 0000000000040400 RSI: 00000000000000f6 RDI: 0000000000000300
[ 95.285558] RBP: ffff9158f3583e88 R08: 0000000000000001 R09: 000000000000042a
[ 95.285562] R10: ffff9158f3583ee0 R11: 0000000000000000 R12: 0000000000000001
[ 95.285567] R13: ffff9158e971e000 R14: ffff9158e971e478 R15: ffff9158de262480
[ 95.285574] FS: 0000000000000000(0000) GS:ffff9158f3580000(0000) knlGS:0000000000000000
[ 95.285579] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 95.285584] CR2: 00007f4ee6b2a000 CR3: 00000001ff80a001 CR4: 00000000003606e0
[ 95.285590] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 95.285594] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 95.28559...

Read more...

Florian W. (florian-will) wrote :
Download full text (11.6 KiB)

I cloned git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack and checked out tag v4.16.5, applied the 6 patches listed at the top of http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.5/ and the one debug patch at https://lkml.org/lkml/2018/4/3/136.

journalctl before/during/after suspend&resume (see below for journalctl after removing and modprobing the r8169 module):

Apr 29 00:17:38 flo-desktop systemd[1]: Reached target Sleep.
Apr 29 00:17:38 flo-desktop systemd[1]: Starting Suspend...
Apr 29 00:17:38 flo-desktop systemd-sleep[1950]: Suspending system...
Apr 29 00:17:38 flo-desktop kernel: PM: suspend entry (deep)
Apr 29 00:17:38 flo-desktop kernel: PM: Syncing filesystems ... done.
Apr 29 00:17:55 flo-desktop kernel: Freezing user space processes ... (elapsed 0.004 seconds) done.
Apr 29 00:17:55 flo-desktop kernel: OOM killer disabled.
Apr 29 00:17:55 flo-desktop kernel: Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
Apr 29 00:17:55 flo-desktop kernel: Suspending console(s) (use no_console_suspend to debug)
Apr 29 00:17:55 flo-desktop kernel: serial 00:04: disabled
Apr 29 00:17:55 flo-desktop kernel: sd 1:0:0:0: [sdb] Synchronizing SCSI cache
Apr 29 00:17:55 flo-desktop kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Apr 29 00:17:55 flo-desktop kernel: sd 0:0:0:0: [sda] Stopping disk
Apr 29 00:17:55 flo-desktop kernel: sd 1:0:0:0: [sdb] Stopping disk
Apr 29 00:17:55 flo-desktop kernel: ACPI: Preparing to enter system sleep state S3
Apr 29 00:17:55 flo-desktop kernel: PM: Saving platform NVS memory
Apr 29 00:17:55 flo-desktop kernel: Disabling non-boot CPUs ...
Apr 29 00:17:55 flo-desktop kernel: IRQ9: New affinity: 0-3 effective: 2
Apr 29 00:17:55 flo-desktop kernel: IRQ25: New affinity: 0,2-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ 25: no longer affine to CPU1
Apr 29 00:17:55 flo-desktop kernel: smpboot: CPU 1 is now offline
Apr 29 00:17:55 flo-desktop kernel: IRQ9: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ12: New affinity: 0-3 effective: 3
Apr 29 00:17:55 flo-desktop kernel: IRQ17: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ22: New affinity: 0,3 effective: 3
Apr 29 00:17:55 flo-desktop kernel: IRQ 22: no longer affine to CPU2
Apr 29 00:17:55 flo-desktop kernel: smpboot: CPU 2 is now offline
Apr 29 00:17:55 flo-desktop kernel: IRQ1: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ12: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ14: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ16: New affinity: 0 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ 16: no longer affine to CPU3
Apr 29 00:17:55 flo-desktop kernel: IRQ19: New affinity: 0-3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: IRQ22: New affinity: 0,3 effective: 0
Apr 29 00:17:55 flo-desktop kernel: smpboot: CPU 3 is now offline
Apr 29 00:17:55 flo-desktop kernel: ACPI: Low-level resume complete
Apr 29 00:17:55 flo-desktop kernel: PM: Restoring platform NVS memory
Apr 29 00:17:55 flo-desktop kernel: PCI-DMA: Resuming GART IOMMU
Apr 29 00:17:55 flo-desktop kernel: PCI-DMA: Restoring G...

Florian W. (florian-will) wrote :

I forgot this yesterday: I accidentally compiled git master HEAD of that repo first. It worked fine, so something fixed this bug between v4.16.5 and 46dc111dfe47. If required I can try to bisect, but it will take a while, my CPU is almost 10 years old (takes 1+ hour to compile the kernel). I guess I could speed this up by using the pre-compiled debs to find a smaller range of commits first.

These are the affinity debug messages for the patched git master, ____i.e. the network worked correctly after suspend&resume___: (log in my previous comment is from v4.16.5, where the network didn't work after resume)
Apr 28 20:24:01 flo-desktop kernel: ACPI: Preparing to enter system sleep state S3
Apr 28 20:24:01 flo-desktop kernel: PM: Saving platform NVS memory
Apr 28 20:24:01 flo-desktop kernel: Disabling non-boot CPUs ...
Apr 28 20:24:01 flo-desktop kernel: IRQ9: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ25: New affinity: 0,2-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ 25: no longer affine to CPU1
Apr 28 20:24:01 flo-desktop kernel: smpboot: CPU 1 is now offline
Apr 28 20:24:01 flo-desktop kernel: IRQ12: New affinity: 0-3 effective: 3
Apr 28 20:24:01 flo-desktop kernel: IRQ14: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ17: New affinity: 0-3 effective: 3
Apr 28 20:24:01 flo-desktop kernel: IRQ22: New affinity: 0,3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ 22: no longer affine to CPU2
Apr 28 20:24:01 flo-desktop kernel: smpboot: CPU 2 is now offline
Apr 28 20:24:01 flo-desktop kernel: IRQ1: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ12: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ15: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ16: New affinity: 0 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ 16: no longer affine to CPU3
Apr 28 20:24:01 flo-desktop kernel: IRQ17: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: IRQ19: New affinity: 0-3 effective: 0
Apr 28 20:24:01 flo-desktop kernel: smpboot: CPU 3 is now offline
Apr 28 20:24:01 flo-desktop kernel: ACPI: Low-level resume complete

no longer affects: linux
Kai-Heng Feng (kaihengfeng) wrote :

Can you try v4.17-rc4? There are several genirq fixes.

On 11/05/18 04:47, Kai-Heng Feng wrote:
> Can you try v4.17-rc4? There are several genirq fixes.
>
@ kai.heng.feng - that appears to work for me here

Linux wolf-wolf 4.17.0-041700rc4-generic

Florian W. (florian-will) wrote :

From http://kernel.ubuntu.com/~kernel-ppa/mainline/:
works: v4.17-rc1, v4.17-rc3, v4.17-rc4 (-rc2 not tested, but I assume it works)
fails: v4.16.7

build for 4.16.8 failed, so I was unable to test that one.

The kernel version 4.17-rc4 is working for me.

Just upgrade from Xubuntu artful to bionic, and just discovered I face the same issue.

Only modprobe -r r8169 + modprobe r8169 restore the network.

For now running default kernek 4.15.0-20-generic.

Kai-Heng Feng (kaihengfeng) wrote :

Please try this kernel, I pulled the genirq fixes.

https://people.canonical.com/~khfeng/lp1752772/

This kernel did not work, when waking from suspension it shows the same dmesg messages and only reloading the r8169 module the Ethernet works again.

Dark Dragon (darkdragon-001) wrote :

The kernel version 4.17-rc5 is also working for me.

Gary Liberson (libergm) wrote :

So if this is the solution, how long before it gets into the standard update to folks?

Thanks in advance,
Gary

Kai-Heng Feng (kaihengfeng) wrote :

Sorry for the late reply.
I should be able to find some time and cherry-pick necessary commits this week.

description: updated
Changed in linux (Ubuntu Bionic):
status: New → Confirmed
Changed in linux (Ubuntu Bionic):
status: Confirmed → Invalid
status: Invalid → Confirmed
Changed in linux (Ubuntu Bionic):
status: Confirmed → Fix Committed
Sergey (gesent) on 2018-06-11
Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Changed in linux (Ubuntu Bionic):
status: Fix Released → Confirmed
Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu Bionic):
status: Confirmed → Fix Committed
Brad Figg (brad-figg) on 2018-06-14
tags: added: verification-needed-bionic
tags: added: verification-failed-bionic
removed: verification-needed-bionic
tags: added: verification-done-bionic
removed: verification-failed-bionic
Kev Bowring (flocculant) on 2018-06-15
tags: added: verification-done-cosmic
Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Steve Dodd (anarchetic) on 2018-07-15
no longer affects: linux-signed-hwe (Ubuntu)
no longer affects: linux-signed-hwe (Ubuntu Bionic)
61 comments hidden view all 141 comments
Andreas Gonell (o-andreas-5) wrote :

$ uname -r
4.15.0-33-generic

$ sudo lshw -C network

  *-network
       Beschreibung: Ethernet interface
       Produkt: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       Hersteller: Realtek Semiconductor Co., Ltd.
       Physische ID: 0
       Bus-Informationen: pci@0000:02:00.0
       Logischer Name: enp2s0
       Version: 03
       Seriennummer: e0:cb:4e:eb:9e:54
       Größe: 1Gbit/s
       Kapazität: 1Gbit/s
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       Konfiguration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl_nic/rtl8168d-2.fw ip=192.168.2.50 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       Ressourcen: irq:18 ioport:e800(Größe=256) memory:fafff000-faffffff memory:faff8000-faffbfff memory:fbef0000-fbefffff

LAN disappears when wake up from hibernation.
Script in /lib/systemd/system-sleep/ with

#!/bin/bash
PROGNAME=$(basename "$0")
state=$1
action=$2

if [[ $state == post ]]; then
    modprobe -r r8169 \
    && modprobe -i r8169 \
fi

seems to be a workaround (tested twice).

greetings
andreas

Andreas Gonell (o-andreas-5) wrote :

[edit #102]
just tested again: set to hibernation -> wake up again -> LAN is gone...
So, modprobe... doesn't work!

Kai-Heng Feng (kaihengfeng) wrote :

Please refer to LP: #1779817 for regression that caused by this issue's fix.

Peter Smith (pdo.smith) wrote :

Kai-Heng Feng,

Success, I tried #1779817:63 and it worked.
This is great, thanks.

Ilya Sheershoff (sheershoff) wrote :

Have same RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller and r8169 driver.

$ lspci -knn | grep Eth -A3
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1462:7b33]
    Kernel driver in use: r8169
    Kernel modules: r8169

See the difference in controller and driver?

I'm online for an hour since:

try connecting via wifi and
1. sudo apt-get update
2. sudo apt-get install r8168-dkms
 - to install the r8168 kernel driver (suppressing the r8169 driver that came default with the kernel)
3. Reboot the PC
4. Enroll the MOK

Credits: https://askubuntu.com/a/1043584/222703

dexter (rekoghllgsuz) wrote :

I have an Ubuntu with kernel 4.15.0-34-generic and network driver sky2.
The network (IP address, DNS server etc.) does *not* resume after a suspend.
So the bug is (still) present.

$ sudo apt-get dist-upgrade
....
## My ubuntu is up-to date. (The backports repo is not enabled.)

$ uname -srvo
Linux 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 GNU/Linux

$ ping 87.229.26.159
PING 87.229.26.159 (87.229.26.159) 56(84) bytes of data.
64 bytes from 87.229.26.159: icmp_seq=1 ttl=56 time=7.24 ms
64 bytes from 87.229.26.159: icmp_seq=2 ttl=56 time=9.73 ms

## Now from menu I click on "Suspend" (to ram).

## After a while I press some keys and the system is resuming.

$ ping 87.229.26.159
connect: Network is unreachable
## return code was 2

$ ping index.hu
ping: index.hu: Temporary failure in name resolution
## return code was 2

$ sudo modprobe -r sky2
$ sudo modprobe sky2

$ ping 87.229.26.159
PING 87.229.26.159 (87.229.26.159) 56(84) bytes of data.
64 bytes from 87.229.26.159: icmp_seq=1 ttl=56 time=9.32 ms
64 bytes from 87.229.26.159: icmp_seq=2 ttl=56 time=10.2 ms

$ ping index.hu
PING index.hu (81.0.120.151) 56(84) bytes of data.
64 bytes from smoking-barrel.ficdn2.index.hu (81.0.120.151): icmp_seq=1 ttl=55 time=8.31 ms
64 bytes from smoking-barrel.ficdn2.index.hu (81.0.120.151): icmp_seq=2 ttl=55 time=10.4 ms

$ NetworkManager -V
1.10.6

Arthur Peters (amp) wrote :

sky2 is a separate driver. So an issue on sky2 should be reported as a separate issue.

RubbelDieCatc (rubbel) wrote :

I can confirm that the fix from DiegoRivera #102 is also functional.
Look here
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1752772/comments/102

The issue with the r8169 driver exists on other distributions ans kernel versions also.
I use Debian with kernel 4.16.0-2-amd64

18:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
 Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
 Flags: bus master, fast devsel, latency 0, IRQ 73
 I/O ports at f000 [size=256]
 Memory at f7604000 (64-bit, non-prefetchable) [size=4K]
 Memory at f7600000 (64-bit, non-prefetchable) [size=16K]
 Capabilities: [40] Power Management version 3
 Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
 Capabilities: [70] Express Endpoint, MSI 01
 Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
 Capabilities: [100] Advanced Error Reporting
 Capabilities: [140] Virtual Channel
 Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
 Capabilities: [170] Latency Tolerance Reporting
 Capabilities: [178] L1 PM Substates
 Kernel driver in use: r8169
 Kernel modules: r8169

bitpt (rui-bitpt) wrote :

Linux Fixo 4.18.0-7-generic #8-Ubuntu SMP Tue Aug 28 18:24:42 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

no always after suspend, restart with
sudo modprobe -r r8169
sudo modprobe -i r8169

rtimai (rtimai) wrote :

Discovered this bug after a recent (but rarely performed) suspend-resume. My hardware and system info below. Hope this may add to data on affected hardware.

@hp15-ay016nr:~$ lsb_release -d ; uname -r ; gnome-shell --version ; echo $DESKTOP_SESSION
Description: Ubuntu 18.04.1 LTS
4.15.0-36-generic
GNOME Shell 3.28.3
Session: ubuntu (x11)

@hp15-ay016nr:~$ sudo lshw -C network
[sudo] password:
  *-network
       description: Ethernet interface
       product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:07:00.0
       logical name: enp7s0
       version: 07
       serial: ec:8e:b5:0d:f6:7e
       size: 100Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8106e-1_0.0.1 06/29/12 ip=192.168.1.64 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:43 ioport:4000(size=256) memory:c5000000-c5000fff memory:c5100000-c5103fff
  *-network DISABLED
       description: Wireless interface
       product: BCM43142 802.11b/g/n
       vendor: Broadcom Limited
       physical id: 0
       bus info: pci@0000:0d:00.0
       logical name: wlp13s0
       version: 01
       serial: 44:1c:a8:ae:23:11
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) latency=0 multicast=yes wireless=IEEE 802.11
       resources: irq:16 memory:c3000000-c3007fff

Kai-Heng Feng (kaihengfeng) wrote :

rtimai, is it possible for you to file a new bug?

The system is not detecting ethernet connection when the ethernet cable is connected after boot.
The system detects ethernet connection when the ethernet cable is already plugged into the system and system is rebooted.
The system stops detecting ethernet connection after waking up from suspend.

Podesta (podesta) wrote :

As suggested, opened a new bug report specific to the sky2 driver: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1798921

rtimai (rtimai) wrote :

@kaihenfeng: I don't understand. Why should my case be a new bug?

Also, new info: I dist-upgraded to Ubuntu 18.10 Cosmic yesterday, and this bug remains. Wired LAN is not available after suspend-resume in release 18.10 as well. My wife uses an older HP dv6-3012he, and this bug occurs in her upgraded laptop too.

Session info:
Ubuntu 18.10
kernel 4.18.0-10-generic
GNOME Shell 3.30.1
ubuntu (gnome on X11)

The good news is neither of us makes use of suspend, and if the system suspends for any reason, LAN is always restored with a system restart. This is a good-enough workaround for us. We prefer wired LAN to Wi-Fi for both security and performance reasons.

rtimai (rtimai) wrote :

This page at a hardware troubleshooter gives a brief description of why resume-after-suspend is prone to loss of connectivity. I think it suggests that this recurring bug may involve any number of factors, such as BIOS/UEFI (updated in 18.10,) networking hardware drivers, grub2, system configuration.

rtimai (rtimai) wrote :

https://askleo.com/why-does-my-network-not-work-after-resuming-from-standby/

sorry, forgot to insert the link. No 'edit comment' facility?

Kai-Heng Feng (kaihengfeng) wrote :

rtimai,

r8169 supports more than 50 different variants. The original bug is for 8168[gh], and yours is r8106e. So it would be better to file a new bug.

I have the same problem on my bionic, and now cosmic, laptop.

Suggesting users raise separate reports for every network interface isn't helpful.

My ethernet controller is RTL 8111/8168/8411.

I have solved this for my laptop, in 2 stages.

First I installed r8168-dkms - the correct driver for my laptop. My network now appears to be up on resuming from suspend.

But I then found I could not open any DNS or IP addresses. Restarting system-resolved did not work. Restarting network-manager did not work. My laptop does run dnsmasq.

I found an answer at https://askubuntu.com/questions/1029250/ubuntu-18-04-ethernet-disconnected-after-suspend which was for an r8169.

This is an edited copy of the solution I found there:

"We need to reload the module for the Ethernet interface when resuming from suspend, after suspend. So I created script /lib/systemd/system-sleep/r8168-refresh:

#!/bin/bash

PROGNAME=$(basename "$0")
state=$1
action=$2

function log {
    logger -i -t "$PROGNAME" "$*"
}

log "Running $action $state"

if [[ $state == post ]]; then
    modprobe -r r8168 \
    && log "Removed r8168" \
    && modprobe -i r8168 \
    && log "Inserted r8168"
fi
and made it executable:

chmod +x /lib/systemd/system-sleep/r8168-refresh

The messages logged from the script will go to /var/log/syslog tagged with the name of the script and its PID. This way you can check whether the script reloaded the kernel module"

This fixed my laptop. There are other suggested ways of doing similar things in the link above.

darren haigh (dazzahaigh) wrote :

also occurs with sky2 driver

Oliver Valls (tramuntanal) wrote :

Also happens with driver=r8152 driverversion=v1.09.9. I'm on an Ubuntu dell xps-13 and I'm using a dock station where the ehternet cable is wired.

Kai-Heng Feng (kaihengfeng) wrote :

Olivers, please file a new bug as r8151 is a completely different device.

Lope (lopeonline) wrote :

Regarding my previous comment
"4.15.0-24-generic resolved the problem for me."
That is true for my Asus N53SV laptop.

However I have a desktop motherboard with onboard
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)

Where I have discovered this issue is occurring on Kernel
Linux 4.15.0-43-generic #46-Ubuntu

I have made a temporary workaround for my desktop like so:

#####
#/etc/systemd/system/fix-r8169.service

[Unit]
Description=Fix RTL-8169 Driver on resume from suspend
After=suspend.target

[Service]
User=root
Type=oneshot
ExecStartPre=[[ $(uname --kernel-release) == "4.15.0-43-generic" ]] && /sbin/modprobe -r r8169
ExecStart=[[ $(uname --kernel-release) == "4.15.0-43-generic" ]] && /sbin/modprobe r8169
TimeoutSec=0
StandardOutput=syslog

[Install]
WantedBy=suspend.target

#systemctl enable fix-r8169.service
#####

This script gives new kernels the opportunity to get it right.
If I update and the new kernel is not working, I'll update the kernel version in the systemd service.

Lope (lopeonline) wrote :

I thought my above script was working, but lately it hasn't worked.
So I changed it to this now, disabled then enabled the service and it worked when I tested it now.

Change the 2 lines above to these

ExecStartPre=/bin/bash -c '[[ $(uname --kernel-release) == "4.15.0-43-generic" ]] && /sbin/modprobe -r r8169'
ExecStart=/bin/bash -c '[[ $(uname --kernel-release) == "4.15.0-43-generic" ]] && /sbin/modprobe r8169'

Vitaliy (librusmc) wrote :

i solved my problem of "ethernet card don't work after returning from suspension" by updating kernel from 4.15 to 4.20 (Ubuntu 18.04 Bionic) using UKUU
to install the latest kernel install Ubuntu Kernel Update Utility
$ sudo add-apt-repository ppa:teejee2008/ppa
$ sudo apt-get install ukuu
disable access control with the following command:
$ sudo xhost +
then install with ukuu
$ sudo ukuu
$ sudo ukuu --install-latest
and reboot
$ sudo reboot

Chris (azchris) wrote :

I am also affected by this bug.
uname -a
Linux platinum-ubuntu 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

sudo lshw -C network
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.1.1 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s

Chris (azchris) wrote :

And, after running the Ubuntu software update, the problem still exists with 4.15.0-43
uname -a
Linux platinum-ubuntu 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Doing the following workaround will 'fix' the bring the ethernet back up for me also.
  sudo modprobe -r r8169
  sudo modprobe -i r8169

Maybe a 'fix' will be released which will work through the normal system update.

Kai-Heng Feng (kaihengfeng) wrote :

Please test the kernel in -proposed, thanks!

pratik (notpartrick) on 2019-04-02
Changed in linux (Ubuntu):
assignee: Kai-Heng Feng (kaihengfeng) → nobody
Gordon Dracup (gordon-dracup) wrote :

Is this issue fixed in 4.18.0-17-generic #18~18.04.1-Ubuntu SMP Fri Mar 15 15:27:12 UTC 2019?

I have just done a fresh install. Modprobe workaround doesn't seem to work. Happy to provide any information required.

gordon:~$ sudo lshw -C network

  *-network
       description: Wireless interface
       product: Wireless 7260
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 73
       serial: 0c:8b:fd:48:fe:40
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.18.0-17-generic firmware=17.948900127.0 ip=192.168.69.113 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:46 memory:e3500000-e3501fff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0.1
       bus info: pci@0000:03:00.1
       logical name: enp3s0f1
       version: 12
       serial: 78:45:c4:c9:4e:61
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8411-2_0.0.1 07/08/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 ioport:4000(size=256) memory:e3404000-e3404fff memory:e3400000-e3403fff

Kai-Heng Feng (kaihengfeng) wrote :

Gordon,
Please file a separate bug report, thanks.

wannabeelinux (bas-douma) wrote :

My HP ProBook 6540b has the following hardware:
  *-network
       description: Ethernet interface
       product: 88E8072 PCI-E Gigabit Ethernet Controller
       vendor: Marvell Technology Group Ltd.
       physical id: 0
       bus info: pci@0000:45:00.0
       logical name: ens1
       version: 10
       serial: 70:5a:b6:b2:9f:50
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sky2 driverversion=1.30 duplex=full ip=192.168.1.23 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:29 memory:d0500000-d0503fff ioport:2000(size=256) memory:d0520000-d053ffff

This problem exist after fresh install and after upgrade from ubuntu 16.04.

Im having the same bug in Kubuntu 19.04 Kernel 5.0.0-15-generic
Using the following commands fixes the problem till next suspend

sudo modprobe -r r8169
sudo modprobe -i r8169

Aleksey (aleksey-yakovlev) wrote :

The same problem in Xubuntu 18.04.2 with kernel 4.15.0-54. The fix is:

sudo modprobe -r r8169
sudo modprobe -i r8169

Please reopen the issue.

Roman Valov (reddot) wrote :

Since changes were introduced with 4.15.0-24, the r8169 driver becomes unusable on x86 machines (16.04 and 18.04 distributions). The device is always in link down state.

Ricci Francesco (ricci69) wrote :

I'm having the same bug in Kubuntu 19.04.03 Kernel 5.0.0-25-generic

This bug must be opened again

Changed in linux-kernel-headers (Ubuntu):
status: New → Confirmed
Kai-Heng Feng (kaihengfeng) wrote :

Ricci,

I guess yours is LP: #1841040? Let's discuss the issue on LP: #1841040 instead.

I can confirm the bug affects kernel version 5.0.0-25-generic (at least, on my machine).
The issue started happening after update to this version.
It didn't exist on any 4.18.0 version that I previously had.

Same here with kernel 5.0.0-25-generic, however the script from post #120 seems to work around this.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1752772/comments/120

After update to kernel 5.0.0-27-generic, it became even worse.
Now Ethernet doesn't work right from the boot, and "modprobe" solution has no effect.

What's interesting, Ethernet interface seems up (and visible to NewtworkManager), but doesn't appear to serve packets at all. As far as packet statistics go, packets are transmitted, but never received.

UPD: The same issue, as described in previous post, reappeared when booting the older 5.0.0-25-generic kernel.
It seems like data race that can be triggered randomly on certain boots.

Again, removing "r8169" didn't help either, but suddenly, putting my laptop to suspension, then repeating the module removal process resolved it.

Displaying first 40 and last 40 comments. View all 141 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers