From owner-freebsd-current@FreeBSD.ORG Tue Jul 26 19:16:09 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 8243216A41F; Tue, 26 Jul 2005 19:16:09 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BFCF43D48; Tue, 26 Jul 2005 19:16:09 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.33] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id j6QJG7o5016700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Jul 2005 12:16:08 -0700 Message-ID: <42E68BF7.4040104@root.org> Date: Tue, 26 Jul 2005 12:16:07 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eric Anderson References: <42E68319.40105@centtech.com> In-Reply-To: <42E68319.40105@centtech.com> Content-Type: multipart/mixed; boundary="------------060207020005090501050003" Cc: acpi@freebsd.org, FreeBSD Current Subject: Re: More ACPI patch problems.. 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: Tue, 26 Jul 2005 19:16:09 -0000 This is a multi-part message in MIME format. --------------060207020005090501050003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Eric Anderson wrote: > After updating, I now see this when on battery: > hw.acpi.battery.life: 97 > hw.acpi.battery.time: 337898 > hw.acpi.battery.state: 1 > hw.acpi.battery.units: 2 > hw.acpi.battery.info_expire: 5 > > And when on AC, my battery life never gets to 100% (like it used to). > > All my systems info is here: > http://www.googlebit.com/freebsd/ Can you run with the attached debug printf patch and let me know the output? Run it both on and off AC power. -- Nate --------------060207020005090501050003 Content-Type: text/plain; name="batt_dbg.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="batt_dbg.diff" Index: sys/dev/acpica/acpi_battery.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_battery.c,v retrieving revision 1.13 diff -u -r1.13 acpi_battery.c --- sys/dev/acpica/acpi_battery.c 23 Jul 2005 19:35:59 -0000 1.13 +++ sys/dev/acpica/acpi_battery.c 25 Jul 2005 15:59:29 -0000 @@ -161,6 +161,7 @@ error = ENOMEM; goto out; } +printf("batt pass1: dev %p ", batt_dev); /* Default info for every battery is "not present". */ acpi_reset_battinfo(&bi[i]); @@ -174,11 +175,13 @@ ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || ACPI_BATT_GET_INFO(batt_dev, bif) != 0) continue; +printf("ok "); /* If a battery is not installed, we sometimes get strange values. */ if (!acpi_battery_bst_valid(&bst[i]) || !acpi_battery_bif_valid(bif)) continue; +printf("valid "); /* Record state and calculate percent capacity remaining. */ valid_units++; @@ -204,10 +207,12 @@ */ if (bst[i].rate > 0 && (bst[i].state & ACPI_BATT_STAT_DISCHARG)) valid_rate += bst[i].rate; +printf("state %d cap %d valid_rate %d\n", bi[i].state, bi[i].cap, valid_rate); } /* If the caller asked for a device but we didn't find it, error. */ if (dev != NULL && dev_idx < 0) { +printf("batt: couldn't find dev %p\n", dev); error = ENXIO; goto out; } @@ -226,6 +231,8 @@ bi[i].min = 0; total_min += bi[i].min; total_cap += bi[i].cap; +printf("batt pass2: min %d total_min %d total_cap %d\n", bi[i].min, total_min, +total_cap); } /* --------------060207020005090501050003--