From owner-freebsd-i386@FreeBSD.ORG Wed Sep 29 18:40:14 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEFB416A4CE for ; Wed, 29 Sep 2004 18:40:14 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9CF743D41 for ; Wed, 29 Sep 2004 18:40:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8TIeEEX093681 for ; Wed, 29 Sep 2004 18:40:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8TIeERF093680; Wed, 29 Sep 2004 18:40:14 GMT (envelope-from gnats) Resent-Date: Wed, 29 Sep 2004 18:40:14 GMT Resent-Message-Id: <200409291840.i8TIeERF093680@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Niki Denev Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55E5616A4CE for ; Wed, 29 Sep 2004 18:31:55 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FAB143D49 for ; Wed, 29 Sep 2004 18:31:55 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i8TIVs66010850 for ; Wed, 29 Sep 2004 18:31:54 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i8TIVsIu010849; Wed, 29 Sep 2004 18:31:54 GMT (envelope-from nobody) Message-Id: <200409291831.i8TIVsIu010849@www.freebsd.org> Date: Wed, 29 Sep 2004 18:31:54 GMT From: Niki Denev To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: i386/72179: Inconsistent apm(8) output regarding the remaining battery time, when running acpi enabled laptop on AC power X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 18:40:15 -0000 >Number: 72179 >Category: i386 >Synopsis: Inconsistent apm(8) output regarding the remaining battery time, when running acpi enabled laptop on AC power >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 29 18:40:14 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Niki Denev >Release: 6.0-CURRENT >Organization: >Environment: FreeBSD phobos.totalterror.net 6.0-CURRENT FreeBSD 6.0-CURRENT #5: Sun Sep 26 12:25:15 EEST 2004 root@phobos.totalterror.net:/usr/src/sys/i386/compile/PHOBOS-X31 i386 >Description: the apm(8) utility will display the total remainig life and time for the batteries, and then will display the remaining time and life for each individual battery on a laptop. When the laptop is connected to AC adaptor, running apm will show the total remaining time as 'unknown', but for the batteries it will print '0:00:00'. >How-To-Repeat: Laptop running on batteries: [root@phobos ]# apm APM version: 1.2 APM Management: Disabled AC Line status: off-line Battery Status: low Remaining battery life: 27% Remaining battery time: 1:16:00 Number of batteries: 1 Battery 0: Battery Status: low Remaining battery life: 27% Remaining battery time: 1:16:00 Resume timer: unknown Resume on ring indicator: disabled Laptop running on AC: [root@phobos ]# apm APM version: 1.2 APM Management: Disabled AC Line status: on-line Battery Status: charging Remaining battery life: 27% Remaining battery time: unknown ^^^^^^^ Number of batteries: 1 Battery 0: Battery Status: charging Remaining battery life: 27% Remaining battery time: 0:00:00 ^^^^^^^ Resume timer: unknown Resume on ring indicator: disabled >Fix: The following patch fixes the problem : ---------------------------------------------------------------------- --- sys/dev/acpica/acpi_cmbat.c.orig Mon Jul 5 15:15:28 2004 +++ sys/dev/acpica/acpi_cmbat.c Mon Jul 5 16:37:02 2004 @@ -655,7 +655,7 @@ battinfo->state = ACPI_BATT_STAT_NOT_PRESENT; } else { battinfo->cap = sc->cap; - battinfo->min = sc->min; + battinfo->min = sc->min ? sc->min : -1; battinfo->state = sc->bst.state; } ---------------------------------------------------------------------- Patch can be found at: http://www.totalterror.net/src/acpi_cmbat.c.patch >Release-Note: >Audit-Trail: >Unformatted: