From owner-freebsd-acpi@FreeBSD.ORG Sat Jun 20 14:05:24 2009 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8142C1065670 for ; Sat, 20 Jun 2009 14:05:24 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0180.hostedemail.com [64.99.136.180]) by mx1.freebsd.org (Postfix) with ESMTP id 348AD8FC23 for ; Sat, 20 Jun 2009 14:05:24 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay04.hostedemail.com (Postfix) with SMTP id 5DCA318AE55B; Sat, 20 Jun 2009 14:05:23 +0000 (UTC) X-Spam-Summary: 74, 5.093, 0, c951c860c5680a2c, d41d8cd98f00b204, peter.piggybox@virgin.net, naylor.b.david@gmail.com:peter.piggybox@virgin.net:ivakras1@gmail.com:freebsd-acpi@freebsd.org, RULES_HIT:1:125:355:379:599:601:617:945:946:960:966:968:973:988:989:1260:1261:1277:1312:1313:1314:1345:1359:1431:1437:1516:1518:1519:1593:1594:1595:1596:1605:1730:1747:1766:1792:1981:2194:2196:2199:2200:2378:2379:2393:2538:2539:2540:2551:2553:2559:2562:2638:2689:2691:2861:2901:2902:2904:3027:3622:3636:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3961:4184:4250:4321:4362:4384:4385:4395:4699:5007:6119:6236:6261:7809:7875:7903:7974:8603:8660:8957:9038:9040:9149:9160:9165:10014, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:1:0 X-Filterd-Recvd-Size: 13518 Received: from ideapad.piggybox (client-86-25-233-122.mcr-bng-011.adsl.virginmedia.net [86.25.233.122]) by omf09.hostedemail.com (Postfix) with ESMTP; Sat, 20 Jun 2009 14:05:20 +0000 (UTC) Received: from ideapad.piggybox (localhost [127.0.0.1]) by ideapad.piggybox (8.14.3/8.14.3) with ESMTP id n5KD4Lpq001088; Sat, 20 Jun 2009 14:04:21 +0100 (BST) (envelope-from peter@ideapad.piggybox) Received: (from peter@localhost) by ideapad.piggybox (8.14.3/8.14.3/Submit) id n5KD4J3q001087; Sat, 20 Jun 2009 14:04:19 +0100 (BST) (envelope-from peter) Date: Sat, 20 Jun 2009 14:04:03 +0100 From: Peter Harrison To: David Naylor Message-ID: <20090620130403.GA1051@ideapad.piggybox> References: <200906181407.11607.naylor.b.david@gmail.com> <20090618174028.GA1023@ideapad.piggybox> <200906182100.15817.naylor.b.david@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906182100.15817.naylor.b.david@gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-acpi@freebsd.org, Peter Harrison Subject: Re: [PATCH] Lenovo S10(e) ACPI X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2009 14:05:25 -0000 Thursday, 18 June 2009 at 21:00:11 +0200, David Naylor said: > On Thursday 18 June 2009 19:40:28 Peter Harrison wrote: > > Thursday, 18 June 2009 at 14:07:07 +0200, David Naylor said: > > > Hi, > > > > > > ((Short version: apply patch and add 'debug.acpi.ec.gpe=1' > > > and 'debug.acpi.ec.timeout=100' to loader.conf and EC (battery, > > > thermal) ?should? work)) > > > > > > After lots of struggling I believe I have found a suitable workaround for > > > this problem. First, an overview of the problem: > > > > > > 1) Sometimes apci_ec0 doesn't attach properly because of EcRead timeout > > > (patch should fix this). > > > 2) Manytimes GPE (interrupt) mode timeout and switches to polling. This > > > causes the Embedded Control to get very upset, making ACPI go back to GPE > > > mode (sysctl debug.acpi.ec.polling=0) fixes the problem until the next > > > time GPE times out. (patch provides workaround). > > > > > > On the latter point, the patch seems to fixes the problem if > > > device_printf is called after each success. This ends up spamming syslog > > > (~3 per second). This, I'm guessing, has something to do with locking and > > > providing a delay until the next call to the EC. > > > > > > This patch has not been tested with burst mode (which never worked) but > > > does work with debug.acpi.ec.max_threads=1 (or 3). > > > > > > Next, how it works: > > > 1) Apply patch and rebuild > > > 2) Add 'debug.acpi.ec.gpe=1' to loader.conf (for the workaround for 2) > > > 3) Add 'debug.acpi.ec.timeout=100' (or even 50) to loader.conf (to > > > minimise impact of GPE timeout). > > > > > > This should allow EC to work (does on my Lenovo S10e), which means > > > battery and temperature status and poweroff should work as expected > > > (besides a few error messages on syslog). > > > > > > WARNING: Beware, slippery when wet, may eat babies (or baby computers), > > > use at your own risk (but it does work for me). > > > > > > Regards, > > > > > > David > > > > > > P.S. If this doesn't work please include details (and dmesg output) and > > > I'll try to help. > > > > David, > > > > Thanks for this. I'll try the patch and report back. I'm running > > 7.2-RELEASE at the moment, do you expect it to work on this, or should I > > move up to STABLE (or CURRENT)? > > That patch should apply cleanly to 7.2 (with some minor offsetting). I don't > think anything should have changed since then that would stop this from > working. > > This patch seems to be more of a workaround than a fix. David, The patch applied cleanly, and I've rebuilt and installed. System seems to work fine and I'm getting battery time reported properly. It still won't poweroff on shutdown though... Thanks for the help. Peter Harrison. uname -a: FreeBSD ideapad.piggybox 7.2-RELEASE-p1 FreeBSD 7.2-RELEASE-p1 #0: Sat Jun 20 11:03:21 BST 2009 peter@ideapad.piggybox:/usr/obj/usr/src/sys/GENERIC i386 dmesg: Copyright (c) 1992-2009 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 7.2-RELEASE-p1 #0: Sat Jun 20 11:03:21 BST 2009 peter@ideapad.piggybox:/usr/obj/usr/src/sys/GENERIC Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Atom(TM) CPU N270 @ 1.60GHz (1596.02-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x106c2 Stepping = 2 Features=0xbfe9fbff Features2=0x40c39d> AMD Features=0x100000 AMD Features2=0x1 Logical CPUs per core: 2 real memory = 1064108032 (1014 MB) avail memory = 1023393792 (975 MB) ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 acpi0: on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) Timecounter "HPET" frequency 14318180 Hz quality 900 Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 acpi_ec0: port 0x62,0x66 on acpi0 acpi_button0: on acpi0 acpi_button1: on acpi0 acpi_acad0: on acpi0 battery0: on acpi0 acpi_lid0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 vgapci0: port 0x1800-0x1807 mem 0xf0500000-0xf057ffff,0xd0000000-0xdfffffff,0xf0600000-0xf063ffff irq 16 at device 2.0 on pci0 agp0: on vgapci0 agp0: detected 7932k stolen memory agp0: aperture size is 256M vgapci1: mem 0xf0580000-0xf05fffff at device 2.1 on pci0 hdac0: mem 0xf0640000-0xf0643fff irq 22 at device 27.0 on pci0 hdac0: HDA Driver Revision: 20090329_0131 hdac0: [ITHREAD] pcib1: irq 17 at device 28.0 on pci0 pci2: on pcib1 bge0: mem 0xf0200000-0xf020ffff irq 16 at device 0.0 on pci2 miibus0: on bge0 brgphy0: PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto bge0: Ethernet address: 00:23:8b:34:79:8a bge0: [ITHREAD] pcib2: irq 16 at device 28.1 on pci0 pci3: on pcib2 pcib3: irq 18 at device 28.2 on pci0 pci5: on pcib3 ndis0: mem 0xf0400000-0xf0403fff irq 18 at device 0.0 on pci5 ndis0: [ITHREAD] ndis0: NDIS API version: 5.1 ndis0: WARNING: using obsoleted if_watchdog interface ndis0: Ethernet address: 00:23:4e:93:a4:de uhci0: port 0x1820-0x183f irq 23 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] uhci0: [ITHREAD] usb0: on uhci0 usb0: USB revision 1.0 uhub0: on usb0 uhub0: 2 ports with 2 removable, self powered uhci1: port 0x1840-0x185f irq 19 at device 29.1 on pci0 uhci1: [GIANT-LOCKED] uhci1: [ITHREAD] usb1: on uhci1 usb1: USB revision 1.0 uhub1: on usb1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0x1860-0x187f irq 18 at device 29.2 on pci0 uhci2: [GIANT-LOCKED] uhci2: [ITHREAD] usb2: on uhci2 usb2: USB revision 1.0 uhub2: on usb2 uhub2: 2 ports with 2 removable, self powered uhci3: port 0x1880-0x189f irq 16 at device 29.3 on pci0 uhci3: [GIANT-LOCKED] uhci3: [ITHREAD] usb3: on uhci3 usb3: USB revision 1.0 uhub3: on usb3 uhub3: 2 ports with 2 removable, self powered ehci0: mem 0xf0844000-0xf08443ff irq 23 at device 29.7 on pci0 ehci0: [GIANT-LOCKED] ehci0: [ITHREAD] usb4: EHCI version 1.0 usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3 usb4: on ehci0 usb4: USB revision 2.0 uhub4: on usb4 uhub4: 8 ports with 8 removable, self powered ugen0: on uhub4 umass0: on uhub4 pcib4: at device 30.0 on pci0 pci6: on pcib4 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1810-0x181f at device 31.1 on pci0 ata0: on atapci0 ata0: [ITHREAD] atapci1: port 0x18c8-0x18cf,0x18c0-0x18c3,0x18a8-0x18af,0x180c-0x180f,0x18b0-0x18bf mem 0xf0844400-0xf08447ff irq 19 at device 31.2 on pci0 atapci1: [ITHREAD] atapci1: AHCI called from vendor specific driver atapci1: AHCI Version 01.10 controller with 4 ports detected ata2: on atapci1 ata2: [ITHREAD] ata3: on atapci1 ata3: port not implemented ata3: [ITHREAD] ata4: on atapci1 ata4: [ITHREAD] ata5: on atapci1 ata5: port not implemented ata5: [ITHREAD] pci0: at device 31.3 (no driver attached) acpi_tz0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model Generic PS/2 mouse, device ID 0 cpu0: on acpi0 est0: on cpu0 p4tcc0: on cpu0 cpu1: on acpi0 est1: on cpu1 p4tcc1: on cpu1 pmtimer0 on isa0 orm0: at iomem 0xdf000-0xdf7ff,0xe0000-0xe17ff pnpid ORM0000 on isa0 ppc0: parallel port not found. sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sio0: configured irq 4 not in bitmap of probed irqs 0 sio0: port may not be enabled sio0: configured irq 4 not in bitmap of probed irqs 0 sio0: port may not be enabled sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0 sio0: type 8250 or not responding sio0: [FILTER] sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ugen1: on uhub1 Timecounters tick every 1.000 msec ad4: 76319MB at ata2-master SATA150 hdac0: HDA Codec #0: Realtek ALC269 pcm0: at cad 0 nid 1 on hdac0 GEOM_LABEL: Label for provider ad4s1a is ufsid/4a20f9c76d1ce80d. GEOM_LABEL: Label for provider ad4s1d is ufsid/4a20f9cb4eb76445. GEOM_LABEL: Label for provider ad4s1e is ufsid/4a20f9c7c991bdb8. GEOM_LABEL: Label for provider ad4s1f is ufsid/4a20f9c769a0ccbb. (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition (probe0:umass-sim0:0:0:0): NOT READY asc:3a,0 (probe0:umass-sim0:0:0:0): Medium not present (probe0:umass-sim0:0:0:0): Unretryable error SMP: AP CPU #1 Launched! da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: Attempt to query device size failed: NOT READY, Medium not present Trying to mount root from ufs:/dev/ad4s1a GEOM_LABEL: Label ufsid/4a20f9c76d1ce80d removed. GEOM_LABEL: Label for provider ad4s1a is ufsid/4a20f9c76d1ce80d. GEOM_LABEL: Label ufsid/4a20f9c7c991bdb8 removed. GEOM_LABEL: Label for provider ad4s1e is ufsid/4a20f9c7c991bdb8. GEOM_LABEL: Label ufsid/4a20f9c769a0ccbb removed. GEOM_LABEL: Label for provider ad4s1f is ufsid/4a20f9c769a0ccbb. GEOM_LABEL: Label ufsid/4a20f9cb4eb76445 removed. GEOM_LABEL: Label for provider ad4s1d is ufsid/4a20f9cb4eb76445. GEOM_LABEL: Label ufsid/4a20f9c76d1ce80d removed. GEOM_LABEL: Label ufsid/4a20f9c7c991bdb8 removed. GEOM_LABEL: Label ufsid/4a20f9c769a0ccbb removed. GEOM_LABEL: Label ufsid/4a20f9cb4eb76445 removed. ndis0: link state changed to UP drm0: on vgapci0 vgapci0: child drm0 requested pci_enable_busmaster info: [drm] AGP at 0xd0000000 256MB info: [drm] Initialized i915 1.6.0 20080730 drm0: [ITHREAD]