Something from LinuxCon that might possibly help with suspend power investigations: https://github.com/01org/suspendresume

It's focus is on measuring and analyzing the speed of suspend and resume. But I wonder if looking at the output might also reveal clues about something that is _not_ suspending properly (or at all).

Regards,
        Neil


On 07/10/15 09:06, H. Nikolaus Schaller wrote:
Hi Neil.

Am 03.10.2015 um 05:16 schrieb Neil Brown <ne...@suse.de>:

"H. Nikolaus Schaller" <h...@goldelico.com> writes:

Could you share a complete description of your setup? So that it is 
reproducible?
I.e. which kernel, which user space, command to suspend/wakeup, boot loader
version, how you measure suspend current etc.

My test board in a GTA04A3, though my GTA04A4 shows much the same sort
of numbers.

There shouldn't be big differences (some A3 boards may have an additional 
LIS302)



User space is Debian/testing ... possibly with a bit of
Debian/experimental (it is listed in my sources.list but I don't
remember why).

I have a few of my own tools running, but they are all idle while I test
power usage.
So screen is blank, sound is off, GPS is off etc.  There is no SIM card
and I haven't tried to access the GSM module at all.

I use the following script while connected to the serial console.
The script disables RS-232 (as the sucks several mA) and turns of the
power source (my board is powered via a 5V source on the 'AC' pins of
the serial connector).
Then it checks the battery, suspends for 5 minutes (default), wakes up
and checks the power usage.
I run that several times and discard the outliers.

With a 4.2 kernel at:
   http://git.neil.brown.name/?p=gta04.git;a=shortlog;h=refs/heads/4.2-gta04
I get numbers like:

46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
46967 uA over 301 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47124 uA over 300 seconds
47281 uA over 299 seconds
47281 uA over 299 seconds
47600 uA over 297 seconds


With the 3.7 kernel
http://git.neil.brown.name/?p=gta04.git;a=shortlog;h=refs/heads/3.7-gta04
I get:

21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21420 uA over 300 seconds
21709 uA over 296 seconds
23556 uA over 300 seconds
23568 uA over 300 seconds
36420 uA over 300 seconds
36420 uA over 300 seconds


Disabling the RS-232 doesn't work on my 3.7 kernel (because the required
GPIO isn't exported by the board file) so I have to unplug the RS-232 to
get proper reading there, but I could easily fix that.

I'd be interested to hear what other people measure.

I have run a quick test with our Letux 4.3-rc4 kernel (on a GTA04A3 with
broken WiFi) and get readings ~170-190 mA.

Well, this is with backlight still enabled (we have no proper config for
that in our tree - it remains "white") and the red power button LED stays
on.

Backlight needs ~20mA@18V which translates to ~100 mA (depends
on battery voltage). So this means the core goes down to less than
70 - 90mA.

And, I did not take care of turning off everything yet. Just a first test.

Subtracting the red LED and some peripherals which may stay powered
makes you readings reasonable. But to really compare I would need a
better test setup (which also requires to be able to charge the battery without
downgrading the kernel).

One observation is that the RTC wakeup does not trigger. I have to wake
up by pressing the power button.

If you don't have a serial port connected you probably need to arrange
some way to start in from the touch-screen, and then make sure the
screen turns off.

NeilBrown

Script is:
#!/bin/sh

I had to replace by /bin/bash to make $[...] recognised.


# disable charging, suspend for 5 minutes and report apparent
# power usage by monitoring battery.

power1=/sys/class/power_supply/twl4030_usb/mode
power2=/sys/class/power_supply/twl4030_ac/mode
chg=/sys/class/power_supply/bq27000-battery/charge_now
rs232=/sys/class/gpio/gpio13/value
rs232dir=/sys/class/gpio/gpio13/direction
delay=${1-300}
[ -f $rs232 ] || { echo 13 > /sys/class/gpio/export; echo high > $rs232dir;}

stty raw -echo -cread
echo 0 > $rs232
echo off > $power1
echo off > $power2
before=`cat $chg`
start=`date '+%s'`
echo $[start+delay] > /sys/class/rtc/rtc0/wakealarm
echo mem > /sys/power/state
after=`cat $chg`
end=`date '+%s'`
echo 1 > $rs232
stty sane
echo auto > $power1
echo auto > $power2

echo $[(before-after)*3600/(end-start)] uA over $[end-start] seconds


BR and thanks for sharing!

Nikolaus

_______________________________________________
Gta04-owner mailing list
gta04-ow...@goldelico.com
http://lists.goldelico.com/mailman/listinfo.cgi/gta04-owner

_______________________________________________
Community mailing list
Community@openphoenux.org
http://lists.goldelico.com/mailman/listinfo.cgi/community
http://www.openphoenux.org

Reply via email to