From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 18 19:00:31 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 9ECE11065673 for ; Thu, 18 Jun 2009 19:00:31 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0135.hostedemail.com [64.99.136.135]) by mx1.freebsd.org (Postfix) with ESMTP id 56AE08FC1E for ; Thu, 18 Jun 2009 19:00:31 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from smtprelay-virgin.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtpgrave06.hostedemail.com (Postfix) with ESMTP id 027A31CFDDD8 for ; Thu, 18 Jun 2009 18:41:36 +0000 (UTC) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay06.hostedemail.com (Postfix) with SMTP id EA9C3195FE7; Thu, 18 Jun 2009 18:41:34 +0000 (UTC) X-Spam-Summary: 2, 0, 0, 28d278a236f8d364, bac5299263adec61, peter.piggybox@virgin.net, naylor.b.david@gmail.com:ivakras1@gmail.com:peter.piggybox@virgin.net:freebsd-acpi@freebsd.org, RULES_HIT:355:379:599:601:945:973:988:989:1260:1261:1277:1312:1313:1314:1345:1359:1437:1516:1518:1519:1534:1542:1593:1594:1595:1596:1711:1730:1747:1766:1792:2379:2393:2551:2553:2559:2562:2689:2691:2904:3027:3354:3622:3865:3866:3867:3868:3869:3871:3872:3873:3876:3877:3961:4184:4250:4362:4699:5007:6114:6119:6261:7903:8501:8660:8957, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:, MSBL:none, DNSBL:none X-Filterd-Recvd-Size: 3213 Received: from ideapad.piggybox (client-81-105-208-80.mcr-bng-011.adsl.virginmedia.net [81.105.208.80]) by omf10.hostedemail.com (Postfix) with ESMTP; Thu, 18 Jun 2009 18:41:34 +0000 (UTC) Received: from ideapad.piggybox (localhost [127.0.0.1]) by ideapad.piggybox (8.14.3/8.14.3) with ESMTP id n5IHeYXP001040; Thu, 18 Jun 2009 18:40:34 +0100 (BST) (envelope-from peter@ideapad.piggybox) Received: (from peter@localhost) by ideapad.piggybox (8.14.3/8.14.3/Submit) id n5IHeYKZ001039; Thu, 18 Jun 2009 18:40:34 +0100 (BST) (envelope-from peter) Date: Thu, 18 Jun 2009 18:40:28 +0100 From: Peter Harrison To: David Naylor Message-ID: <20090618174028.GA1023@ideapad.piggybox> References: <200906181407.11607.naylor.b.david@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906181407.11607.naylor.b.david@gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-acpi@freebsd.org, peter.piggybox@virgin.net 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: Thu, 18 Jun 2009 19:00:32 -0000 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)? Thanks again, Peter Harrison.