Bug 207889 - Significant increase in Sandy Bridge laptop power consumption after Linux 3.8 i915 update
Summary: Significant increase in Sandy Bridge laptop power consumption after Linux 3.8...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-10 19:19 UTC by Ed Maste
Modified: 2016-03-21 02:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2016-03-10 19:19:06 UTC
As reported on the FreeBSD-x11 mailing list - adding this PR to keep track of the details.

I updated my regular laptops to HEAD after this commit and have discovered that the power consumption seems to have increased significantly. This is on a Thinkpad X220 (Sandy Bridge).

With a r286085 kernel installed on the disk it and reports 11W while idle at a vt(4) console without the driver loaded. After loading i915kms.ko but still at the
vt(4) console that increased to 14W.

Booting from a USB stick at r296565 showed 13W initially, rising to 25W after loading i915kms.ko.

These numbers were obtained from "acpiconf -i0" while running on battery, from the "Present rate" value near the bottom of the output. In each case I let the laptop wait in the same state for a couple of minutes and then compared 3 or 4 results over 20 seconds or so to see that the power consumption appeared to have settled.

There are related reports on Linux although those specifically deal with increased power consumption after a suspend-resume cycle.

Links:
https://bugs.freedesktop.org/show_bug.cgi?id=54089
https://bugzilla.kernel.org/show_bug.cgi?id=58971
https://patchwork.kernel.org/patch/2827634/ (patch v1)
https://github.com/torvalds/linux/commit/7dcd2677ea912573d9ed4bcd629b0023b2d11505
https://github.com/torvalds/linux/commit/d11a96d0a4927e8948a6e92a581779f961d9745b

I have the two patches referenced there in a code review (https://reviews.freebsd.org/D5599) although it does not address the increased consumption immediately after loading i915kms.ko, and after further testing it seems I see normal power consumption after suspend-resume with and without the patch.
Comment 1 Jan Bramkamp 2016-03-11 09:45:51 UTC
Does your /boot/loader.conf contain this line?

    drm.i915.enable_rc6=7
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-03-21 01:00:26 UTC
A commit references this bug:

Author: emaste
Date: Mon Mar 21 00:59:30 UTC 2016
New revision: 297128
URL: https://svnweb.freebsd.org/changeset/base/297128

Log:
  i915: disable GEN6_MBCTL write in gen6_init_clock_gating

  This write came from Linux commit b4ae3f22d238 which has been implicated
  in Sandy Bridge power consumption issues (albeit under different
  conditions on Linux). Disabling it restores normal power consumption on
  my Sandy Bridge laptop (Thinkpad X220).

  PR:		207889
  Reviewed by:	cem, dumbbell
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D5665

Changes:
  head/sys/dev/drm2/i915/intel_pm.c
Comment 3 Ed Maste freebsd_committer freebsd_triage 2016-03-21 01:23:30 UTC
(In reply to Jan Bramkamp from comment #1)

I tried with enable_rc6 set to 0, 1, and 7.

One other note: When I observed excessive power consumption the "residency since boot" counters were static in "sysctl hw.dri.0.info.i915_drpc_info" output. "RC6 residency since boot" was high and unchanging, while the other two were zero. This is similar to a report in a comment in https://bugs.freedesktop.org/show_bug.cgi?id=54089

The Linux commit that introduced this regression is b4ae3f22d238617ca11610b29fde16cf8c0bc6e0, which was in response to
https://bugs.freedesktop.org/show_bug.cgi?id=50237 .  Disabling the MBCTL write from that commit, on Sandy Bridge, restores the power consumption to normal.