[ltp] Re: Re: help in troubleshooting ACPI drain with 2.6.10 please
Jan-Hendrik Benter
linux-thinkpad@linux-thinkpad.org
Thu, 6 Jan 2005 23:19:34 +0100
--Boundary-00=_2lb3B+VBS1ntK+T
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I have T40p with Debian (Sarge) and 2.6.10 vanilla. In S3 it still uses about
2 watts per hour and is noticable warm.
I have modified my sleep.sh to read battery capacity before and after resume
and calculate values to /var/log/battery.log, like:
Tue Jan 4 21:04:42 CET 2005
before: 34280 mW
after: 33140 mW
diff: -1140 mW
seconds: 2242 sec
result: -1830 mW/h
Maybe some others like to share, what values they get, you get propper results
after ~ 20 - 30 minutes ...
Regards,
Jan-Hendrik
--Boundary-00=_2lb3B+VBS1ntK+T
Content-Type: application/x-shellscript;
name="sleep.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="sleep.sh"
#!/bin/sh
# /etc/acpi/sleep.sh
# remove USB for external mouse before sleeping
if lsmod | grep '^usbhid' >/dev/null ; then
/sbin/modprobe -r -s usbhid
fi
if lsmod | grep '^uhci_hcd' >/dev/null ; then
/sbin/modprobe -r -s uhci_hcd
fi
if lsmod | grep '^ehci_hcd' >/dev/null ; then
/sbin/modprobe -r -s ehci_hcd
fi
hwclock --systohc
LOG=/var/log/battery.log
date >> $LOG
DATE_BEFORE=`date +%s`
BAT_BEFORE=`grep 'remaining capacity' /proc/acpi/battery/BAT0/state | awk '{print $3}'`
echo "before: $BAT_BEFORE mW" >> $LOG
echo 3 > /proc/acpi/sleep
DATE_AFTER=`date +%s`
BAT_AFTER=`grep 'remaining capacity' /proc/acpi/battery/BAT0/state | awk '{print $3}'`
echo "after: $BAT_AFTER mW" >> $LOG
DIFF=`echo "$BAT_AFTER - $BAT_BEFORE" | bc`
SECONDS=`echo "$DATE_AFTER - $DATE_BEFORE" | bc`
echo "diff: $DIFF mW" >> $LOG
echo "seconds: $SECONDS sec" >> $LOG
USAGE=`echo "($DIFF * 60 * 60) / ($SECONDS)" | bc`
echo "result: $USAGE mW/h" >> $LOG
echo "" >> $LOG
if !(lsmod | grep '^ehci_hcd') >/dev/null ; then
/sbin/modprobe -s ehci_hcd
fi
if !(lsmod | grep '^uhci_hcd') >/dev/null ; then
/sbin/modprobe -s uhci_hcd
fi
if !(lsmod | grep '^usbhid') >/dev/null ; then
/sbin/modprobe -s usbhid
fi
hwclock --hctosys
--Boundary-00=_2lb3B+VBS1ntK+T--