Subject: Bogus ACPI battery information in recent current
To: None <current-users@netbsd.org>
From: Sverre Froyen <sverre@viewmark.com>
List: current-users
Date: 12/13/2007 14:27:50
--Boundary-00=_XPaYHwMBaFpuPSK
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

With the latest current, I'm seeing bogus values for the battery information.  
An example (4.99.42 from this morning):

# envstat
[acpiacad0]
  connected:         ON
[acpibat0]
         present:         ON
      design cap:    164.010 Wh
   last full cap:    492.800 Wh
      technology:          1
  design voltage:     10.772 V
        warn cap:     24.640 Wh ( 5.00%)
         low cap:      0.200 Wh ( 0.04%)
         voltage:     12.417 V
     charge rate:        N/A
  discharge rate:        N/A
          charge:     44.690 Wh ( 9.07%)
        charging:        OFF
    charge state:     NORMAL
[acpitz0]
     temperature:     52.000 degC
[aps0]
          aps0 X_ACCEL:        476
          aps0 Y_ACCEL:        514
            aps0 X_VAR:        476
            aps0 Y_VAR:        514
           aps0 TEMP_1:     44.000 degC
           aps0 TEMP_2:     44.000 degC
  aps0 Keyboard Active:         ON
     aps0 Mouse Active:        OFF
         aps0 Lid Open:         ON

Notice the "last full cap" and the "design cap" values.  There is also a very 
noticable delay before the output appears.  With my latest good kernel 
(4.99.40 from 6 Dec),  I get

#  envstat
[acpiacad0]
  connected:         ON
[acpibat0]
         present:         ON
      design cap:     51.840 Wh
   last full cap:     45.440 Wh
      technology:          1
  design voltage:     10.800 V
        warn cap:      2.272 Wh ( 5.00%)
         low cap:      0.200 Wh ( 0.44%)
         voltage:     12.417 V
     charge rate:        N/A
  discharge rate:        N/A
          charge:     44.690 Wh (98.35%)
        charging:        OFF
    charge state:     NORMAL
[acpitz0]
     temperature:     54.000 degC
[aps0]
          aps0 X_ACCEL:        477
          aps0 Y_ACCEL:        515
            aps0 X_VAR:        477
            aps0 Y_VAR:        515
           aps0 TEMP_1:     46.000 degC
           aps0 TEMP_2:     46.000 degC
  aps0 Keyboard Active:        OFF
     aps0 Mouse Active:        OFF
         aps0 Lid Open:         ON

I've attached the dmesg from 4.99.42, below.  I suspect a pertinent line is:

acpiec0 at acpi0 (EC, PNP0C09-0): ACPI Embedded Controller (disabled)

The dmesg diffs the working 4.99.40 kernel are:

7,8c7,8
< NetBSD 4.99.40 (ABBOR) #31: Thu Dec  6 08:04:40 MST 2007
<       toor@abbor.fesk.com:/usr/src/objdir/sys/arch/i386/compile.i386/ABBOR
---
> NetBSD 4.99.42 (ABBOR) #33: Thu Dec 13 10:12:28 MST 2007
>       toor@abbor.viewmark.com:/usr/src/sys/arch/i386/compile/obj.i386/ABBOR
13a14,15
> SMBIOS rev. 2.33 @ 0xe0010 (61 entries)
> IBM 2378FVU (ThinkPad T42)
14a17
> ACPI Warning (tbfadt-0510): Optional field "Gpe1Block" has zero address or 
length: 000000000000102C/0 [20070320]
31,37c34,35
< acpi0: using Intel ACPI CA subsystem version 20060217
< acpi0: X/RSDT: OemId <IBM   ,TP-1R   ,00003230>, AslId < LTP,00000000>
< acpi0: found ECDT, GPE 28
< acpi0: SCI interrupting at int 9
< acpi0: fixed-feature power button present
< timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
< ACPI-Fast 24-bit timer
---
> acpi0: using Intel ACPI CA subsystem version 20070320
> acpi_pci_link: WARNING: powerhook_establish is deprecated
38a37
> acpi_pci_link: WARNING: powerhook_establish is deprecated
39a39
> acpi_pci_link: WARNING: powerhook_establish is deprecated
40a41
> acpi_pci_link: WARNING: powerhook_establish is deprecated
42a44
> acpi_pci_link: WARNING: powerhook_establish is deprecated
48a51,56
> acpi_pci_link: WARNING: powerhook_establish is deprecated
> acpiecdt0 at acpi0: ACPI Embedded Controller via ECDT
> acpi0: SCI interrupting at int 9
> acpi0: fixed-feature power button present
> timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
> ACPI-Fast 24-bit timer
80,81c88
< acpiec0 at acpi0 (EC, PNP0C09-0): ACPI Embedded Controller
< acpiec0: io 0x62,0x66
---
> acpiec0 at acpi0 (EC, PNP0C09-0): ACPI Embedded Controller (disabled)
86,87c93
< acpitz0 at acpi0 (THM0)acpitz0: unable to get polling interval; using 
default of 30.0s
< : critical 93.0C passive 57.0C, passive cooling
---
> acpitz0 at acpi0 (THM0): critical 93.0C passive 61.0C, passive cooling
193c199
< auich0: measured ac97 link rate at 48000 Hz
---
> auich0: measured ac97 link rate at 48001 Hz, will use 48000 Hz
225d230
< pad0: Pseudo Audio Device

This issue is perhaps related to the "acpi overheating" thread:

http://mail-index.netbsd.org/current-users/2007/12/12/0030.html

Ideas?

Thanks,

Sverre

--Boundary-00=_XPaYHwMBaFpuPSK
Content-Type: text/plain;
  charset="us-ascii";
  name="dmesg"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="dmesg"

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.99.42 (ABBOR) #33: Thu Dec 13 10:12:28 MST 2007
	toor@abbor.viewmark.com:/usr/src/sys/arch/i386/compile/obj.i386/ABBOR
total memory = 510 MB
avail memory = 490 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
BIOS32 rev. 0 found at 0xfd750
SMBIOS rev. 2.33 @ 0xe0010 (61 entries)
IBM 2378FVU (ThinkPad T42)
mainbus0 (root)
ACPI Warning (tbfadt-0510): Optional field "Gpe1Block" has zero address or length: 000000000000102C/0 [20070320]
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium M (Dothan) (686-class), 1698.63 MHz, id 0x6d6
cpu0: features afe9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR>
cpu0: features afe9f9bf<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features afe9f9bf<FXSR,SSE,SSE2,SS,TM,SBF>
cpu0: features2 180<EST,TM2>
cpu0: "Intel(R) Pentium(R) M processor 1.70GHz"
cpu0: I-cache 32 KB 64B/line 8-way, D-cache 32 KB 64B/line 8-way
cpu0: L2 cache 2 MB 64B/line 8-way
cpu0: ITLB 128 4 KB entries 4-way, 2 4 MB entries fully associative
cpu0: DTLB 128 4 KB entries 4-way, 8 4 MB entries 4-way
cpu0: using thermal monitor 2
cpu0: Enhanced SpeedStep (1340 mV) 1700 MHz
cpu0: Enhanced SpeedStep frequencies available (MHz): 1700 1400 1200 1000 800 600
cpu0: 64 page colors
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20070320
acpi_pci_link: WARNING: powerhook_establish is deprecated
LNKA: ACPI: Found matching pin for 0.29.INTA at func 0: 11
acpi_pci_link: WARNING: powerhook_establish is deprecated
LNKD: ACPI: Found matching pin for 0.29.INTB at func 1: 11
acpi_pci_link: WARNING: powerhook_establish is deprecated
LNKC: ACPI: Found matching pin for 0.29.INTC at func 2: 11
acpi_pci_link: WARNING: powerhook_establish is deprecated
LNKH: ACPI: Found matching pin for 0.29.INTD at func 7: 11
LNKC: ACPI: Found matching pin for 0.31.INTA at func 1: 255
acpi_pci_link: WARNING: powerhook_establish is deprecated
LNKB: ACPI: Found matching pin for 0.31.INTB at func 3: 11
LNKA: ACPI: Found matching pin for 1.0.INTA at func 0: 11
LNKA: ACPI: Found matching pin for 2.0.INTA at func 0: 11
LNKB: ACPI: Found matching pin for 2.0.INTB at func 1: 11
LNKA: ACPI: Found matching pin for 2.1.INTA at func 0: 11
LNKC: ACPI: Found matching pin for 2.2.INTA at func 0: 11
acpi_pci_link: WARNING: powerhook_establish is deprecated
acpiecdt0 at acpi0: ACPI Embedded Controller via ECDT
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
ACPI-Fast 24-bit timer
CPU (ACPI Object Type 'Processor' [0x0c]) at acpi0 not configured
LNKA (PNP0C0F) [PCI interrupt link device] at acpi0 not configured
LNKB (PNP0C0F) [PCI interrupt link device] at acpi0 not configured
LNKC (PNP0C0F) [PCI interrupt link device] at acpi0 not configured
LNKD (PNP0C0F) [PCI interrupt link device] at acpi0 not configured
LNKH (PNP0C0F) [PCI interrupt link device] at acpi0 not configured
MEM (PNP0C01) [System Board] at acpi0 not configured
acpilid0 at acpi0 (LID, PNP0C0D): ACPI Lid Switch
acpibut0 at acpi0 (SLPB, PNP0C0E): ACPI Sleep Button
PCI0 (PNP0A03) [PCI/PCI-X Host Bridge] at acpi0 not configured
SIO (PNP0C02) [Plug and Play motherboard register resources] at acpi0 not configured
PIC (PNP0000) [AT Interrupt Controller] at acpi0 not configured
attimer0 at acpi0 (TIMR, PNP0100): AT Timer
attimer0: io 0x40-0x43 irq 0
DMAC (PNP0200) [AT DMA Controller] at acpi0 not configured
pcppi0 at acpi0 (SPKR, PNP0800)
pcppi0: io 0x61
midi0 at pcppi0: PC speaker (CPU-intensive output)
sysbeep0 at pcppi0
npx1 at acpi0 (FPU, PNP0C04)
npx1: io 0xf0 irq 13
npx1: reported by CPUID; using exception 16
RTC (PNP0B00) [AT Real-Time Clock] at acpi0 not configured
pckbc1 at acpi0 (KBD, PNP0303): kbd port
pckbc1: io 0x60,0x64 irq 1
pckbc2 at acpi0 (MOU, IBM0057): aux port
pckbc2: irq 12
FDC (PNP0700) [PC standard floppy disk controller] at acpi0 not configured
UART (PNP0501) [16550A-compatible COM port] at acpi0 not configured
LPT (PNP0400) [Standard LPT printer port] at acpi0 not configured
FIR (IBM0071) at acpi0 not configured
acpiec0 at acpi0 (EC, PNP0C09-0): ACPI Embedded Controller (disabled)
PUBS (ACPI Object Type 'Power' [0x0b]) at acpi0 not configured
acpibat0 at acpi0 (BAT0, PNP0C0A-0): ACPI Battery (Control Method)
acpiacad0 at acpi0 (AC, ACPI0003-0): ACPI AC Adapter
HKEY (IBM0068) at acpi0 not configured
acpitz0 at acpi0 (THM0): critical 93.0C passive 61.0C, passive cooling
apm0 at acpi0: Power Management spec V1.2
pcppi0: attached to attimer0
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 5.9
pms0: Palm detect, Multi-finger
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82855PM MCH Host Controller (rev. 0x03)
agp0 at pchb0: aperture at 0xd0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0: Intel 82855PM Host-AGP Bridge (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: ATI Technologies Radeon Mobility 9600/9700 (M10/11) NP (rev. 0x00)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
direct rendering for vga1 unsupported
uhci0 at pci0 dev 29 function 0: Intel 82801DB USB UHCI Controller (rev. 0x01)
uhci0: interrupting at irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1: Intel 82801DB USB UHCI Controller (rev. 0x01)
uhci1: interrupting at irq 11
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2: Intel 82801DB USB UHCI Controller (rev. 0x01)
uhci2: interrupting at irq 11
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7: Intel 82801DB USB EHCI Controller (rev. 0x01)
ehci0: interrupting at irq 11
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
ppb1 at pci0 dev 30 function 0: Intel 82801BAM Hub-PCI Bridge (rev. 0x81)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
cbb0 at pci2 dev 0 function 0: Texas Instruments PCI4520 PCI-CardBus Bridge w/ IEEE 1394 Host Controller (rev. 0x01)
cbb1 at pci2 dev 0 function 1: Texas Instruments PCI4520 PCI-CardBus Bridge w/ IEEE 1394 Host Controller (rev. 0x01)
wm0 at pci2 dev 1 function 0: Intel i82540EP 1000BASE-T Ethernet, rev. 3
wm0: interrupting at irq 11
wm0: 32-bit 33MHz PCI bus
wm0: 64 word (6 address bits) MicroWire EEPROM
wm0: Ethernet address 00:16:41:54:fa:fe
makphy0 at wm0 phy 1: Marvell 88E1011 Gigabit PHY, rev. 4
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
iwi0 at pci2 dev 2 function 0: Intel PRO/Wireless LAN 2200BG Mini-PCI Adapter (rev. 0x05)
iwi0: interrupting at irq 11
iwi0: 802.11 address 00:0e:35:38:b0:33
iwi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
cbb0: interrupting at irq 11
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3
pcmcia0 at cardslot0
cbb1: interrupting at irq 11
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 6
pcmcia1 at cardslot1
ichlpcib0 at pci0 dev 31 function 0
ichlpcib0: Intel 82801DB ISA Bridge (rev. 0x01)
timecounter: Timecounter "ichlpcib0" frequency 3579545 Hz quality 1000
ichlpcib0: 24-bit timer
ichlpcib0: TCO (watchdog) timer configured.
ichlpcib0: SpeedStep enabled
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801DBM IDE Controller (ICH4-M) (rev. 0x01)
piixide0: bus-master DMA support present
piixide0: primary channel configured to compatibility mode
piixide0: primary channel interrupting at irq 14
atabus0 at piixide0 channel 0
piixide0: secondary channel configured to compatibility mode
piixide0: secondary channel interrupting at irq 15
atabus1 at piixide0 channel 1
ichsmb0 at pci0 dev 31 function 3: Intel 82801DB SMBus Controller (rev. 0x01)
ichsmb0: interrupting at irq 11
iic0 at ichsmb0: I2C bus
auich0 at pci0 dev 31 function 5: i82801DB/DBM (ICH4/ICH4M) AC-97 Audio
auich0: interrupting at irq 11
auich0: ac97: Analog Devices AD1981B codec; headphone, 20 bit DAC, no 3D stereo
auich0: ac97: ext id 601<AC97_22,AMAP,VRA>
Intel 82801DB AC97 Modem Controller (modem communications, revision 0x01) at pci0 dev 31 function 6 not configured
isa0 at ichlpcib0
lpt2 at isa0 port 0x3bc-0x3bf irq : polled
aps0 at isa0 port 0x1600-0x161e
aps0: Thinkpad Active Protection System
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
isapnp0: no ISA Plug 'n Play devices found
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
auich0: measured ac97 link rate at 48001 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent
uhub4 at uhub0 port 1
uhub4: ALCOR Monterey KBD HUB, class 9/0, rev 1.10/0.01, addr 2
uhub4: 3 ports with 2 removable, self powered
wd0 at atabus0 drive 0: <WDC WD1200VE-00KWT0>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 111 GB, 232581 cyl, 16 head, 63 sec, 512 bytes/sect x 234441648 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-STCD-RW/DVD DRIVE GCC-4242N, , 0201> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(piixide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
uhidev0 at uhub4 port 1 configuration 1 interface 0
uhidev0: ALCOR Monterey KBD HUB, rev 1.10/0.01, addr 3, iclass 3/1
ukbd0 at uhidev0
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub4 port 1 configuration 1 interface 1
uhidev1: ALCOR Monterey KBD HUB, rev 1.10/0.01, addr 3, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 1: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid2 at uhidev1 reportid 3: input=3, output=1, feature=1
uhidev2 at uhub4 port 3 configuration 1 interface 0
uhidev2: Logitech N48, rev 1.00/4.01, addr 4, iclass 3/1
ums0 at uhidev2: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio1 at pad0: half duplex
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
acpibat0: battery info: SANYO, LION, IIM-92P1087  5392
acpiacad0: AC adapter online.

--Boundary-00=_XPaYHwMBaFpuPSK--