Subject: Problems reading ACPI battery status on IBM ThinkPad T30
To: None <current-users@netbsd.org>
From: Rafal Boni <rafal@pobox.com>
List: current-users
Date: 01/11/2004 22:55:34
--==_Exmh_212387103280P
Content-Type: text/plain; charset=us-ascii

Folks:
	I've just made room on my T30 to install NetBSD and while I have
	a lot of stuff working and configured now, there's a serious issue
	with me not being able to get battery status via ACPI (APM seemed
	to hand the machine and ACPI has the added bonus of helping out
	with autoconfiguration, so I figured I'd go that route).

	Here's a summary of what happens:

Machine/kernel info (and a bunch of ACPI errors), sources are from after
Thor's fixes to the bufcache code (sources probably from Fri night):

	NetBSD 1.6ZG (T30) #4: Sat Jan 10 22:09:57 EST 2004
	    rafal@groo-the-wanderer:/home/rafal/netbsd-src/sys/arch/i386/compile/T30
	total memory = 255 MB
	avail memory = 245 MB
	BIOS32 rev. 0 found at 0xfd7e0
	PCI BIOS rev. 2.1 found at 0xfd8fe
	PCI IRQ Routing Table rev. 1.0 found at 0xfdeb0, size 256 bytes (14 entries)
	PCI Interrupt Router at 000:31:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
	mainbus0 (root)
	cpu0 at mainbus0: (uniprocessor)
	cpu0: Intel Pentium 4 (686-class), 1794.25 MHz, id 0xf27
	cpu0: features bfebf9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
	cpu0: features bfebf9ff<PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX>
	cpu0: features bfebf9ff<FXSR,SSE,SSE2,SS,HTT,TM,SBF>
	cpu0: I-cache 12K uOp cache 8-way, D-cache 8 KB 64b/line 4-way
	cpu0: L2 cache 512 KB 64b/line 8-way
	cpu0: ITLB 4K/4M: 128 entries
	cpu0: DTLB 4K/4M: 64 entries
	cpu0: 16 page colors
	acpi0 at mainbus0
	acpi0: using Intel ACPI CA subsystem version 20031203
	acpi0: X/RSDT: OemId <IBM   ,TP-1I   ,00002060>, AslId < LTP,00000000>
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.FDC_._INI] (Node 0xc0a24460), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__._INI] (Node 0xc0a1e860), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT0._STA] (Node 0xc0a1e040), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT0._STA] (Node 0xc0a1e040), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT1._STA] (Node 0xc0a1fec0), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT1._STA] (Node 0xc0a1fec0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BGID] (Node 0xc0a245a0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BINI] (Node 0xc0a245c0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BSTA] (Node 0xc0a24600), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.IDE0.SCND.MSTR._STA] (Node 0xc0a244c0), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.PCI0.IDE0.SCND.MSTR._STA] (Node 0xc0a244c0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BGID] (Node 0xc0a245a0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BINI] (Node 0xc0a245c0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BSTA] (Node 0xc0a24600), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.USB0.URTH.UNST._STA] (Node 0xc0a24ae0), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.PCI0.USB0.URTH.UNST._STA] (Node 0xc0a24ae0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BGID] (Node 0xc0a245a0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BINI] (Node 0xc0a245c0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BSTA] (Node 0xc0a24600), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.USB0.URTH.UNST._STA] (Node 0xc0a24ae0), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.PCI0.USB0.URTH.UNST._STA] (Node 0xc0a24ae0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BGID] (Node 0xc0a245a0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BINI] (Node 0xc0a245c0), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BSTA] (Node 0xc0a24600), AE_NOT_EXIST
	    ACPI-1290: *** Error: Method execution failed [\_SB_.NEST._STA] (Node 0xc0a24320), AE_NOT_EXIST
	    ACPI-0178: *** Error: Method execution failed [\_SB_.NEST._STA] (Node 0xc0a24320), AE_NOT_EXIST
	acpi0: SCI interrupting at int 9

envstat -l reports lots of interesting fields about the batteries:
	acpibat0 present
	acpibat0 design cap
	acpibat0 last full cap
	acpibat0 technology
	acpibat0 design voltage
	acpibat0 warn cap
	acpibat0 low cap
	acpibat0 voltage
	acpibat0 charge rate
	acpibat0 discharge rate
	acpibat0 charge
	acpibat0 charging
	acpibat0 discharging
	acpibat1 present
	acpibat1 design cap
	acpibat1 last full cap
	acpibat1 technology
	acpibat1 design voltage
	acpibat1 warn cap
	acpibat1 low cap
	acpibat1 voltage
	acpibat1 charge rate
	acpibat1 discharge rate
	acpibat1 charge
	acpibat1 charging
	acpibat1 discharging
	acpiacad0 connected
	acpiacad0 disconnected
	acpitz0 temperature

However, many of the really interesting fields are not retrieved correctly:

     acpibat0 design cap    acpibat0 charge rate acpibat0 discharge rate         acpibat0 charge       acpibat0 charging    acpibat0 discharging
                      Wh                       W                       W                      Wh                    bool                    bool
                   47.52                       *                       *                       *                       *                       *

While performing this query, the kernel outputs:
	ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.GBST] (Node 0xc0a1e140), AE_AML_INTERNAL
	ACPI-1290: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT0._BST] (Node 0xc0a1e000), AE_AML_INTERNAL
	acpibat0: failed to evaluate _BST: AE_AML_INTERNAL

note that I get a some other errors from the battery as well (I think this
may be due to the acpitz 30s poll?):
	
	acpibat0: failed to evaluate _BST: AE_TYPE
	acpibat0: failed to evaluate _BST: AE_TYPE
	acpibat0: failed to evaluate _BST: AE_TYPE

But some parameters are retrieved fine, including the manf and chemistry
info:
	acpibat0 at acpi0 (PNP0C0A-0): ACPI Battery (Control Method)
	acpibat1 at acpi0 (PNP0C0A-1): ACPI Battery (Control Method)
	acpibat0: battery info: SANYO, LION, IBM-02K7072,  2965

And envstat -r does report correct-looking values for other battery data:
	
	       acpibat0 present
	    acpibat0 design cap:     47.520 Wh
	 acpibat0 last full cap:     37.880 Wh
	    acpibat0 technology:          1
	acpibat0 design voltage:     10.800 V
	      acpibat0 warn cap:      1.894 Wh ( 5.00%)
	       acpibat0 low cap:      0.200 Wh ( 0.53%)
	 acpiacad0 disconnected
	    acpitz0 temperature:     49.050 degC

Any clues/hints?

Thanks!
--rafal

----
Rafal Boni                                                     rafal@pobox.com
  We are all worms.  But I do believe I am a glowworm.  -- Winston Churchill


--==_Exmh_212387103280P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
Comment: Exmh version 2.5 07/13/2001

iD8DBQFAAhq1EeBxM8fTAkwRAmadAKDdCqsnzl35wynBU3+65loodP8YsQCguLO3
dLdSPP8sCg0bAy3N5ICVBQw=
=e02x
-----END PGP SIGNATURE-----

--==_Exmh_212387103280P--