From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 18 12:06:08 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 12B931065670 for ; Thu, 18 Jun 2009 12:06:07 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-yx0-f200.google.com (mail-yx0-f200.google.com [209.85.210.200]) by mx1.freebsd.org (Postfix) with ESMTP id 159588FC1B for ; Thu, 18 Jun 2009 12:06:06 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: by yxe38 with SMTP id 38so1399066yxe.3 for ; Thu, 18 Jun 2009 05:06:06 -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:mime-version:content-type :content-transfer-encoding:message-id; bh=GepP6WI5VB7n2F/LpwhzDaoidxrqBUI9mWWEI+aI9sg=; b=ZigDoSV/WXZBc/cmnvyFFYUvDWKV+t6uqhDZ7dz8D9FD35grFriH8I78kiYMu+875E iQb6dJliLXaiILLjkZs17iV837GGQUpRGxnLuaJ86gdgNVWI45H6F1hIPSotIpW0cgXE /7eoMhDYE2iNMoSQBTVKTfJcNYwwFvIlivW4c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:mime-version :content-type:content-transfer-encoding:message-id; b=mJH+t8PEHzTBHUUNY6bp4a8eKl+whTXyrtCPaPkEqUSTBgjVe8V6PuK1viyRhTeJrw 7hE/pBuQN5bD0gD9Us6tDAuxgKbFSpdVMYLoFCNplb8+ugmCKJvjkzETaXwuh+ERWayn bFvwwLVmtsu7bQpYWU5HslVl6cFeTAAvLPGxU= Received: by 10.100.12.1 with SMTP id 1mr1924504anl.107.1245326766401; Thu, 18 Jun 2009 05:06:06 -0700 (PDT) Received: from dragonmini.dg ([196.34.241.123]) by mx.google.com with ESMTPS id 34sm1733370agc.39.2009.06.18.05.06.01 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Jun 2009 05:06:05 -0700 (PDT) From: David Naylor Organization: Private To: ivakras1@gmail.com, peter.piggybox@virgin.net Date: Thu, 18 Jun 2009 14:07:07 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2924633.iESVrH0bAT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200906181407.11607.naylor.b.david@gmail.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-acpi@freebsd.org Subject: [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 12:06:08 -0000 --nextPart2924633.iESVrH0bAT Content-Type: multipart/mixed; boundary="Boundary-01=_s3iOKAdkgcyo+Et" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_s3iOKAdkgcyo+Et Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, ((Short version: apply patch and add 'debug.acpi.ec.gpe=3D1'=20 and 'debug.acpi.ec.timeout=3D100' to loader.conf and EC (battery,=20 thermal) ?should? work)) After lots of struggling I believe I have found a suitable workaround for t= his=20 problem. First, an overview of the problem: 1) Sometimes apci_ec0 doesn't attach properly because of EcRead timeout (pa= tch=20 should fix this). =20 2) Manytimes GPE (interrupt) mode timeout and switches to polling. This=20 causes the Embedded Control to get very upset, making ACPI go back to GPE=20 mode (sysctl debug.acpi.ec.polling=3D0) fixes the problem until the next ti= me=20 GPE times out. (patch provides workaround). =20 On the latter point, the patch seems to fixes the problem if device_printf = is=20 called after each success. This ends up spamming syslog (~3 per second). = =20 This, I'm guessing, has something to do with locking and providing a delay= =20 until the next call to the EC. =20 This patch has not been tested with burst mode (which never worked) but doe= s=20 work with debug.acpi.ec.max_threads=3D1 (or 3). =20 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 minimi= se=20 impact of GPE timeout). =20 This should allow EC to work (does on my Lenovo S10e), which means battery = and=20 temperature status and poweroff should work as expected (besides a few erro= r=20 messages on syslog). =20 WARNING: Beware, slippery when wet, may eat babies (or baby computers), use= at=20 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'l= l=20 try to help. --Boundary-01=_s3iOKAdkgcyo+Et-- --nextPart2924633.iESVrH0bAT 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) iEYEABECAAYFAko6Le8ACgkQUaaFgP9pFrJ8UgCfdRM5Bco60F2KOwQyNJtB0dNb 9IYAn16swVQBKbASDGllF2cOQv8PQror =WkWJ -----END PGP SIGNATURE----- --nextPart2924633.iESVrH0bAT--