Fix Runtime PM for r8169

Bug #1757422 reported by Kai-Heng Feng
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Xenial
Invalid
Undecided
Unassigned
Artful
Won't Fix
Medium
Unassigned
Bionic
Triaged
Medium
Unassigned
linux-oem (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

===SRU Justification===
[Impact]
r8169 stays in D0 even when no ethernet cable is plugged in. This drains
lots of power (~3W). The tested laptop uses 5.5W when r8169 is in D0,
1.8W when r8169 is in D3. The power saved is substantial.

[Fix]
Improved rumtime PM logic to let the device gets suspended (D3) when the
port is not in used and the link is down.

[Test Case]
The chip version is 8168h/8111h.
Test when no ethernet gets plugged.

Powertop shows power consumption is roughly 5.5W.
lspci shows the device is in D0.

With the patch,
The power consumption is reduced to 1.8W.
lspci shows the device is in D3, PME# is correctly enabled.
Plug ethernet cable can corretly wake up the device.
Unplug the cable, the device gets suspended to D3 correctly.

[Regression Potential]
Medium.
- r8169 is so ubiquitous, with lots of different chip versions. It's
  hard to test all of them.
- PCI D3 needs system firmware (ACPI) support, this might hit some
  plaform bugs.
- the code is still in v4.16-rc*, so it's not well tested by end users.

CVE References

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

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 1757422

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
tags: added: originate-from-1755720 somerville
Changed in linux (Ubuntu Xenial):
status: New → Triaged
Changed in linux (Ubuntu Artful):
status: New → Triaged
Changed in linux (Ubuntu Bionic):
status: Incomplete → Triaged
Changed in linux (Ubuntu Xenial):
importance: Undecided → Medium
Changed in linux (Ubuntu Artful):
importance: Undecided → Medium
Changed in linux (Ubuntu Bionic):
importance: Undecided → Medium
Timo Aaltonen (tjaalton)
Changed in linux-oem (Ubuntu Artful):
status: New → Fix Committed
no longer affects: linux-oem (Ubuntu Xenial)
no longer affects: linux-oem (Ubuntu)
no longer affects: linux-oem (Ubuntu Artful)
no longer affects: linux-oem (Ubuntu Bionic)
no longer affects: linux (Ubuntu Xenial)
Changed in linux (Ubuntu Xenial):
status: New → Invalid
Changed in linux-oem (Ubuntu Xenial):
status: New → Fix Committed
no longer affects: linux (Ubuntu Bionic)
Revision history for this message
Timo Aaltonen (tjaalton) 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-xenial' to 'verification-done-xenial'. If the problem still exists, change the tag 'verification-needed-xenial' to 'verification-failed-xenial'.

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-xenial
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I can confirm r8169 enters D3 when no cable is plugged.

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

This bug was fixed in the package linux-oem - 4.13.0-1024.27

---------------
linux-oem (4.13.0-1024.27) xenial; urgency=medium

  * linux-oem: 4.13.0-1024.27 -proposed tracker (LP: #1763296)

  * [8086:3e92] display becomes blank after S3 (LP: #1763271)
    - drm/i915/edp: Allow alternate fixed mode for eDP if available.
    - drm/i915/dp: rename intel_dp_is_edp to intel_dp_is_port_edp
    - drm/i915/dp: make is_edp non-static and rename to intel_dp_is_edp
    - drm/i915/edp: Do not do link training fallback or prune modes on EDP

  * No network with e1000e driver on 4.13.0-38-generic (LP: #1762693)
    - e1000e: Fix e1000_check_for_copper_link_ich8lan return value.

linux-oem (4.13.0-1023.25) xenial; urgency=medium

  * linux-oem: 4.13.0-1023.25 -proposed tracker (LP: #1761464)

  * Fix Runtime PM for r8169 (LP: #1757422)
    - r8169: only enable PCI wakeups when WOL is active
    - PCI: Add pcim_set_mwi(), a device-managed pci_set_mwi()
    - r8169: switch to device-managed functions in probe
    - r8169: remove netif_napi_del in probe error path
    - r8169: remove unneeded rpm ops in rtl_shutdown
    - r8169: improve runtime pm in rtl8169_check_link_status
    - r8169: improve runtime pm in general and suspend unused ports

  * Ryzen/Raven Ridge USB ports do not work (LP: #1756700)
    - xhci: Fix front USB ports on ASUS PRIME B350M-A
    - SAUCE: xhci: Fix USB ports for Dell Inspiron 5775

  * Miscellaneous Ubuntu changes
    - Rebase to 4.13.0-39.44

  [ Ubuntu: 4.13.0-39.44 ]

  * linux: 4.13.0-39.44 -proposed tracker (LP: #1761456)
  * intel-microcode 3.20180312.0 causes lockup at login screen(w/ linux-
    image-4.13.0-37-generic) (LP: #1759920) // CVE-2017-5715 (Spectre v2
    Intel) // CVE-2017-5754
    - x86/mm: Reinitialize TLB state on hotplug and resume
  * intel-microcode 3.20180312.0 causes lockup at login screen(w/ linux-
    image-4.13.0-37-generic) (LP: #1759920) // CVE-2017-5715 (Spectre v2 Intel)
    - Revert "x86/mm: Only set IBPB when the new thread cannot ptrace current
      thread"
    - x86/speculation: Use Indirect Branch Prediction Barrier in context switch
  * DKMS driver builds fail with: Cannot use CONFIG_STACK_VALIDATION=y, please
    install libelf-dev, libelf-devel or elfutils-libelf-devel (LP: #1760876)
    - [Packaging] include the retpoline extractor in the headers
  * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
    - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
    - x86/paravirt, objtool: Annotate indirect calls
    - [Packaging] retpoline -- add safe usage hint support
    - [Packaging] retpoline-check -- only report additions
    - [Packaging] retpoline -- widen indirect call/jmp detection
    - [Packaging] retpoline -- elide %rip relative indirections
    - [Packaging] retpoline -- clear hint information from packages
    - KVM: x86: Make indirect calls in emulator speculation safe
    - KVM: VMX: Make indirect call speculation safe
    - x86/boot, objtool: Annotate indirect jump in secondary_startup_64...

Read more...

Changed in linux-oem (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this needs to be sent for bionic too, or linux-oem (4.13) -> -hwe (4.15) upgrade will regress

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

There are some subsequent fixes for r8169. I'll make a new backport for this in Bionic.

Revision history for this message
Andy Whitcroft (apw) wrote : Closing unsupported series nomination.

This bug was nominated against a series that is no longer supported, ie artful. The bug task representing the artful nomination is being closed as Won't Fix.

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

Changed in linux (Ubuntu Artful):
status: Triaged → Won't Fix
no longer affects: linux (Ubuntu)
Changed in linux-oem (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
Changed in linux-oem (Ubuntu):
assignee: Kai-Heng Feng (kaihengfeng) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-oem - 4.15.0-1043.48

---------------
linux-oem (4.15.0-1043.48) bionic; urgency=medium

  [ Ubuntu: 4.15.0-52.56 ]

  * Remote denial of service (resource exhaustion) caused by TCP SACK scoreboard
    manipulation (LP: #1831638)
    - SAUCE: tcp: tcp_fragment() should apply sane memory limits
  * Remote denial of service (system crash) caused by integer overflow in TCP
    SACK handling (LP: #1831637)
    - SAUCE: tcp: limit payload size of sacked skbs

 -- Stefan Bader <email address hidden> Fri, 14 Jun 2019 10:39:16 +0200

Changed in linux-oem (Ubuntu Bionic):
status: New → Fix Released
Changed in linux-oem (Ubuntu):
status: New → Fix Released
Changed in hwe-next:
status: New → 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.