[coreboot] Lenovo X200 running Coreboot drains 3-4W more power than with Vendor BIOS

Daniel Kulesz daniel.ina1 at googlemail.com
Tue May 3 00:47:12 CEST 2016

Hi all,

On Mon, 2 May 2016 13:16:15 +0200
Nico Huber <nico.huber at secunet.com> wrote:

> On 02.05.2016 01:06, Daniel Kulesz wrote:
> >>> - disabling "cpu power management" makes the idle consumption raise to 12,8W
> >> Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
> >>
> > 
> > Nope, I am only comparing with highest backlight now, so it is 12.8W versus 10.0W here.
> Hmmm, 2.8W... whatever that option does it confuses me.
Well, I assume it disables C3 and C4.

> >>> Any ideas which could solve this mystery?
> >>>
> >> One more thing you can test, in case your Linux uses the intel_idle
> >> driver: There is a kernel parameter intel_idle.max_cstate, if you boot
> >> the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it
> >> should use C1/C2 but not C3/C4 and thus behave more like coreboot.
> >>
> > Okay. I was just aware of the generic "processor.max_cstate=2"
> > parameter. I tried with both parameters using the vendor BIOS and here
> > are the results:
> > 
> > intel_idle.max_cstate=2: 10W in idle at full brightness (no effect)
> > processor.max_cstate=2: 12.6W in idle at full brightness
> > 
> > So it seems plausible that this issue is related to Coreboot not
> > (properly?) supporting C3/C4. So this is a known issue then? If yes,
> > imho it should be *definitely* documented on the wiki page since it
> > could be a "showstopper" for many adopters who need the maximum battery
> > life the X200 is able to deliver only with the vendor BIOS at this point
> > in time ...
> Well, let's see what we got:
>   o 10.0W with "cpu power management"
>   o 12.6W with "cpu power management" but max_cstate=2
>   o 12.8W without "cpu power management"
> FWIW, C2 usually saves more power. So I wonder how good your measuring
> at the wall plug works. Another easy option to measure the power
> consumption is looking at what the battery reports (usually
> /sys/class/power_supply/BAT0/power_now).

Well sure, the power consumption is not always 100% steady so sometimes it "flakes" around 0.1 - 0.2W, depending on e.g. whether the fan is running or not or what some background processes do. So I just took the values that were reported by my external meter most of the time, and these could be slightly off. 

Of course, using "power_now" would be more accurate, but I would have to take like 100 measurements and then take the median or something like that. Imho a bit too much in this case since the difference is so big that it's visible at first sight.

> Regarding C3/C4 support, AFAIK, we implemented it fully but it just
> didn't work on the system we originally ported coreboot for (Roda/RK9).
> The system kept resetting whenever it should enter (or maybe exit) C3,
> IIRC.  You could give it a try on your X200 though. Whatever the issue
> on the RK9 was, it might be board specific.
> If you want to try it, in src/mainboard/lenovo/x200/cstates.c add:
>         {
>                 /* acpi C3 / cpu C3 */
>                 3, 0x02,  300,
>                 { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 }
>         },
> for C3 or
>         {
>                 /* acpi C3 / cpu C4 */
>                 3, 0x02,  300,
>                 { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 }
>         },
> for C4. You can not have all of them, as ACPI only supports three
> C-states.

Indeed this was a *VERY GOOD* hint! I added the line with the C4 states and idle power consumption dropped to about 11.5W running my regular OS and with Wifi on. So I again disassembled the keyboard/palmrest, removed the wifi card and did exactly the same measurements as before. And here are the results:

Benchmark results: almost like before (not crappy like with vendor BIOS!), a little worse because it probably takes a few ms for the CPU to wake up from C4 first.
Stress test: >37.2W (as before)

Idle, max brightness: 10.8W (!!)
Idle, lowest brightness: 7.8W (!!)

...and after running "powertop --auto-tune":
Idle, max brightness: 9.9W
Idle, lowest brightness: 6.9W
Screen off:6.4W

Sounds stupid, but I'm really impressed now! But... is there a reason C4 is not enabled by default then? I mean, if it makes trouble, you can always disable it (at least on Linux) with the command line parameters as discussed previously. Imho, it should be at least configurable using the regular config mechanism.

@Zoran: I also have an X220 (2nd gen Core I5) on which I did not undertake any Coreboot experiments yet. But I suppose you are rather asking for much newer CPUs from the 6th and 7th generation?

Cheers, Daniel

More information about the coreboot mailing list