Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2004 18:31:54 GMT
From:      Niki Denev <nike_d@cytexbg.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   i386/72179: Inconsistent apm(8) output regarding the remaining battery time, when running acpi enabled laptop on AC power
Message-ID:  <200409291831.i8TIVsIu010849@www.freebsd.org>
Resent-Message-ID: <200409291840.i8TIeERF093680@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409291831.i8TIVsIu010849>