acpi battery rework patch
Wilko Bulte
wb at freebie.xs4all.nl
Mon Jul 25 18:41:09 GMT 2005
On Mon, Jul 25, 2005 at 09:29:03AM -0700, Nate Lawson wrote..
> Marcin Jessa wrote:
> >On Sun, 24 Jul 2005 17:15:12 -0700
> >Nate Lawson <nate at root.org> wrote:
> >>As far as Eric's result, I'll check that on my systems as well. I
> >>_think_ the previous behavior was more correct (-1 = unknown) so I'll
> >>commit this minor change. The "state" variable should not have changed
> >>so please let me know for sure if it has. "1" means "discharging" which
> >>doesn't sound right if you're on AC power. If you just recently plugged
> >>in the laptop, try polling the status a few more times (apm(8) gives
> >>more detail) and see if it catches up. Some systems lag reporting
> >>various values until they are sure they've restabilized after an AC line
> >>change.
> >>
> >>Marcin, if your system reports a valid rate of use, we can calculate
> >>time. If you're on AC power, there is no time available (since your
> >>batteries aren't discharging at any rate). Try a previous
> >>kernel/acpi.ko to be certain what the behavior used to be.
> >
> >
> >[yazzy at lapdance:~]> uname -a
> >FreeBSD lapdance.yazzy.net 6.0-BETA1 FreeBSD 6.0-BETA1 #4: Sat Jul 23
> >17:35:13 CEST 2005
> >root at lapdance.yazzy.net:/usr/obj/usr/src/sys/LAPDANCE-6.0 i386
> >
> >Running on AC:
> >[yazzy at lapdance:~]> sysctl -a | grep battery
> >hw.acpi.battery.life: 23
> >hw.acpi.battery.time: -1
> >hw.acpi.battery.state: 2
> >hw.acpi.battery.units: 1
> >hw.acpi.battery.info_expire: 5
> >
> >Running on battery:
> >[yazzy at lapdance:~]> sysctl -a | grep battery
> >hw.acpi.battery.life: 23
> >hw.acpi.battery.time: 41
> >hw.acpi.battery.state: 1
> >hw.acpi.battery.units: 1
> >hw.acpi.battery.info_expire: 5
> >[yazzy at lapdance:~]>
>
> And with a 7-current kernel, everything is the same except "time" is
> always -1 both on and off AC power?
>
> Please try this patch with 7-current and report its output both on and
> off power. It prints out more debugging info each time the battery is read.
On an Compaq EVO N160, on AC power
Trying to mount root from ufs:/dev/ad0s2a
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
ichss0: transition to 1 failed
ichss0: transition to 1 failed
ichss0: transition to 1 failed
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
ichss0: transition to 1 failed
ichss0: transition to 1 failed
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 2 cap 0 valid_rate 0
batt pass2: min 0 total_min 0 total_cap 0
ichss0: transition to 1 failed
APM version: 1.2
APM Management: Enabled
AC Line status: on-line
Battery Status: charging
Remaining battery life: 0%
Remaining battery time: 0:00:00
Number of batteries: 1
Battery 0:
Battery Status: charging
Remaining battery life: 0%
Remaining battery time: 0:00:00
wb at chuck ~:
Unplugging AC power:
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
batt pass1: dev 0xc15e3100 ok valid state 1 cap 0 valid_rate 1082
batt pass2: min 166 total_min 166 total_cap 0
wb at chuck ~:
wb at chuck ~: apm
APM version: 1.2
APM Management: Enabled
AC Line status: off-line
Battery Status: low
Remaining battery life: 0%
Remaining battery time: 2:31:00
Number of batteries: 1
Battery 0:
Battery Status: low
Remaining battery life: 0%
Remaining battery time: 2:31:00
wb at chuck ~:
--
Wilko Bulte wilko at FreeBSD.org
More information about the freebsd-acpi
mailing list