From owner-freebsd-current@FreeBSD.ORG Mon Jul 25 23:19:48 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBB7516A41F; Mon, 25 Jul 2005 23:19:48 +0000 (GMT) (envelope-from lists@yazzy.org) Received: from mail.yazzy.org (mail.yazzy.org [217.8.140.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3938343D48; Mon, 25 Jul 2005 23:19:45 +0000 (GMT) (envelope-from lists@yazzy.org) Received: from localhost.localdomain (yazzy.yazzy.org [192.168.98.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.yazzy.org (Postfix) with ESMTP id 387C439812; Tue, 26 Jul 2005 01:19:59 +0200 (CEST) Date: Tue, 26 Jul 2005 01:19:43 +0200 From: Marcin Jessa To: Nate Lawson Message-Id: <20050726011943.0abe83a0.lists@yazzy.org> In-Reply-To: <42E5134F.706@root.org> References: <42E1481F.5040306@root.org> <20050723133819.36efb537.lists@yazzy.org> <42E29CAA.1020007@root.org> <20050724215818.55f951ae.lists@yazzy.org> <42E42F10.3030309@root.org> <20050725091221.106a0368.lists@yazzy.org> <42E5134F.706@root.org> Organization: YazzY.org X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, freebsd-current@freebsd.org Subject: Re: acpi battery rework patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2005 23:19:49 -0000 On Mon, 25 Jul 2005 09:29:03 -0700 Nate Lawson wrote: > Marcin Jessa wrote: > > On Sun, 24 Jul 2005 17:15:12 -0700 > > Nate Lawson 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@lapdance:~]> uname -a > > FreeBSD lapdance.yazzy.net 6.0-BETA1 FreeBSD 6.0-BETA1 #4: Sat Jul 23 17:35:13 CEST 2005 root@lapdance.yazzy.net:/usr/obj/usr/src/sys/LAPDANCE-6.0 i386 > > > > Running on AC: > > [yazzy@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@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@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. > > -- > Nate > Test results: Running on 6.0-BETA1 #4: Sat Jul 23 17:35:13 CEST 2005 - AC: hw.acpi.battery.life: 99 hw.acpi.battery.time: -1 hw.acpi.battery.state: 0 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 - Battery: hw.acpi.battery.life: 87 hw.acpi.battery.time: 103 hw.acpi.battery.state: 1 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 Back on AC (notice battery.state changed to 2 from previous 0 on AC (charging) ) hw.acpi.battery.life: 86 hw.acpi.battery.time: -1 hw.acpi.battery.state: 2 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 Running on FreeBSD 7.0-CURRENT #5: Mon Jul 25 22:21:05 CEST 2005 without the patch - AC: hw.acpi.battery.life: 100 hw.acpi.battery.time: -1 hw.acpi.battery.state: 0 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 - Battery: hw.acpi.battery.life: 99 hw.acpi.battery.time: 113 hw.acpi.battery.state: 1 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 Running on FreeBSD 7.0-CURRENT #5: Mon Jul 25 22:21:05 CEST 2005 with the patch: # sysctl -a | grep battery - AC: hw.acpi.battery.life: 70 hw.acpi.battery.time: -1 hw.acpi.battery.state: 2 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 dev.battery.0.%desc: ACPI Control Method Battery dev.battery.0.%driver: battery dev.battery.0.%location: handle=\_SB_.PCI0.LPC_.EC__.BAT0 dev.battery.0.%pnpinfo: _HID=PNP0C0A _UID=0 dev.battery.0.%parent: acpi0 - Battery: hw.acpi.battery.life: 70 hw.acpi.battery.time: 125 hw.acpi.battery.state: 1 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 dev.battery.0.%desc: ACPI Control Method Battery dev.battery.0.%driver: battery dev.battery.0.%location: handle=\_SB_.PCI0.LPC_.EC__.BAT0 dev.battery.0.%pnpinfo: _HID=PNP0C0A _UID=0 dev.battery.0.%parent: acpi0