[ltp] X60: Off is *not* off ;)

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Tue, 12 Feb 2008 15:11:53 -0200


On Tue, 12 Feb 2008, Nils Faerber wrote:
> Some days ago I reported that my X60 drains battery even in off mode. I
> did some very painful analysis...
> 
> Since Lenovo refused service for non-Windows systems I backed-up Linux
> and installed XP.
> Guess what? It did not drain the battery in off mode!

There are two "off" modes: S4 and S5.  S4 is *indeed* allowed to leave some
stuff powered up, so that it can wake up.

S5 should turn the blasted thing as off as it can go, which in previous
ThinkPads means the EC remains on if the AC is plugged, and complete power
off (except for the CMOS and RTC) otherwise.  The EC draws a few mW if that
much (it has an sleep mode that draws a ridiculously small ammount of power,
but I have no idea if that mode is used).

> First difference I found was that if I suspend to disk and have the AC
> still connected the ethernet PHY was still active (LEDs blinking). This
> did not happen with WinXP. When AC is disconnected the LEDs go off but I
> thought, well, if threre is a difference there then there might be more
> and some even with AC disconnected.

You can direct Linux to sleep-to-disk using S5 instead of S4, I believe.

> After some more searching I found that one can specify the off method
> after suspend to disk - in the sys entry /sys/power/disk - Who did
> invent that name? Well, anyway, after changing this from "platform"
> (ACPI shutdown method) to "shutdown" (hard power off?) the LEDs were off
> with AC connected after suspend to disk.

Ah, "shutdown" is S5, yes :)  "platform mode" is S4.

> So I thought - hey, I got it!
> Far from it. After 48h the battery lost 60%! In off mode!

[...]

> So last night I tried the ultimate test - braindead as it seemed: I did
> not use suspend to disk but did do a shutdown - at 97% battery.
> Today I rebooted the machine and guess what? Still 97%!

So, suspend-to-disk with S5 is being handled differently than pure S5 by the
X60 firmware?  This is very interesting.

> 1. There are oviously at least three power off methods! Not that off
> would be simply off, no no. There is half off with PHY active with AC,
> then there is drain-off and there is real off-off.
> What a mess!

There are TWO shutdown states: S4 and S5.  S4 is allowed to leave crap
powered on, so that it can wake up from events like modem rings, ethernet
wakeup packets, etc.  S5 is to just turn the frigging thing off and be done
about that.

Clearly, something is wrong with S5.

> 2. The power-off method in Linux is broken! Why does suspend to disk not
> use the same power-off method as a shutdown?

1. suspend and power-off are different.

2. S4 can have differences that are better suited to suspend-to-disk (e.g.
leave a led on).

3. some laptops will only work with one of the two.

> How can I tell suspend to disk to use the off-off method???

It should be doing so after you told it to.  Clearly it is not shutting down
every device like the standard shutdown path, since it is somehow letting
the firmware know there is a difference.

Sounds like something to report on bugzilla.kernel.org, to me.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh