From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 18 18:58:58 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 EED671065714 for ; Thu, 18 Jun 2009 18:58:58 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-gx0-f207.google.com (mail-gx0-f207.google.com [209.85.217.207]) by mx1.freebsd.org (Postfix) with ESMTP id 8FCDC8FC1F for ; Thu, 18 Jun 2009 18:58:58 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: by gxk3 with SMTP id 3so1782226gxk.19 for ; Thu, 18 Jun 2009 11:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=IeGmwgG+uFnQFtjZGJ3FEob21GK8aDBTnLdXQi4aobY=; b=xXHtzZtfVQL0vx6UFLpYHpwm4+gQ0SsxQXAK3Ipm9I3fM7zsanW0eXtq7f8JcH4WvN akKP2W61k9bjswsC6qSJvQMCI0n64oFZJlXt0NGEldNK7Zxdyn8Q2lCDSQIrvxrwhMxd zu75/nVwzaBhOKUFGo/HhPs/WUngLt5ICd/dI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; b=BHNp840YIVzQwcr/M0wNjq+LYr8EGYO+pRzXLlqbLxsRZ401b9jyDU8XXbuEjB9qhK y1mVTBi+QyjiItxAslX+bGt4JC2L+XUVaHZqvrQ/NlFze+tviWgYh1liAKgQ1RNE3FqG /xHqyNUbapEHX6AmCBmS6eABs4mIvTVTUg3eQ= Received: by 10.90.67.6 with SMTP id p6mr1379981aga.25.1245351537790; Thu, 18 Jun 2009 11:58:57 -0700 (PDT) Received: from dragonmini.dg ([196.34.241.123]) by mx.google.com with ESMTPS id 2sm3100427aga.58.2009.06.18.11.58.55 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Jun 2009 11:58:57 -0700 (PDT) From: David Naylor Organization: Private To: Peter Harrison Date: Thu, 18 Jun 2009 21:00:11 +0200 User-Agent: KMail/1.9.10 References: <200906181407.11607.naylor.b.david@gmail.com> <20090618174028.GA1023@ideapad.piggybox> In-Reply-To: <20090618174028.GA1023@ideapad.piggybox> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1319401.eydA1EDmlZ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200906182100.15817.naylor.b.david@gmail.com> Cc: freebsd-acpi@freebsd.org 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 18:58:59 -0000 --nextPart1319401.eydA1EDmlZ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=3D1' > > and 'debug.acpi.ec.timeout=3D100' to loader.conf and EC (battery, > > thermal) ?should? work)) > > > > After lots of struggling I believe I have found a suitable workaround f= or > > 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 G= PE > > mode (sysctl debug.acpi.ec.polling=3D0) 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 sysl= og > > (~3 per second). This, I'm guessing, has something to do with locking a= nd > > 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=3D1 (or 3). > > > > Next, how it works: > > 1) Apply patch and rebuild > > 2) Add 'debug.acpi.ec.gpe=3D1' to loader.conf (for the workaround for 2) > > 3) Add 'debug.acpi.ec.timeout=3D100' (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=20 think anything should have changed since then that would stop this from=20 working. =20 This patch seems to be more of a workaround than a fix. =20 --nextPart1319401.eydA1EDmlZ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEABECAAYFAko6jr8ACgkQUaaFgP9pFrKoeACfcvyWE+EKspWRVZaimFE5jLo6 VfYAn3mTpv/62bNmcbdcEqcUaYJPYRSR =nbD/ -----END PGP SIGNATURE----- --nextPart1319401.eydA1EDmlZ--