From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 25 08:59:51 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14D4106566C for ; Sun, 25 Jan 2009 08:59:51 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE4C8FC27 for ; Sun, 25 Jan 2009 08:59:51 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 7E7E78FC27 for ; Sun, 25 Jan 2009 11:47:50 +0300 (MSK) Received: from [192.168.1.2] (ppp91-76-107-171.pppoe.mtu-net.ru [91.76.107.171]) by mx0.deglitch.com (Postfix) with ESMTPA id 1AA308FC1D; Sun, 25 Jan 2009 11:47:49 +0300 (MSK) From: Ilya Bakulin To: freebsd-mobile@freebsd.org, freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org Organization: Deglitch Networks Date: Sun, 25 Jan 2009 11:47:56 +0300 Message-Id: <1232873276.3689.2.camel@kibab-nb.kibab.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 FreeBSD GNOME Team Port X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Jan 25 11:47:50 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 497c2736967001885613896 Content-Type: multipart/mixed; boundary=DSPAM_MULTIPART_EX-96700 X-Mailman-Approved-At: Sun, 25 Jan 2009 12:28:07 +0000 Cc: Subject: ACPI AE_NO_HARDWARE_RESPONSE workaround X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2009 08:59:51 -0000 --DSPAM_MULTIPART_EX-96700 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-HtyI8ZXFqPJSego7sc22" --=-HtyI8ZXFqPJSego7sc22 Content-Type: multipart/mixed; boundary="=-9IEzOQBN4p+R9MZFrs6a" --=-9IEzOQBN4p+R9MZFrs6a Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi! I have Dell Vostro 1310 laptop, this system has some problems with ACPI. Sometimes I see this in dmesg: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Jan 24 20:36:00 kibab-nb kernel: acpi_ec0: wait timed out (no response), forcing polled mode Jan 24 20:36:00 kibab-nb kernel: acpi_ec0: EcRead: failed waiting to get data Jan 24 20:36:00 kibab-nb kernel: ACPI Exception (evregion-0529): AE_NO_HARDWARE_RESPONSE, Returned by Handler for [EmbeddedControl] [20070320] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D These messages repeat constantly till rebooting. After that I can't query battery state through "acpiconf -i 0" -- it either reports constant charge percent (for example, 48% -- till laptop shutdowns due to low charge) or reports nothing. Just in case anyone has the same problems with ACPI, I want to share my workaround for this problem, and ask if it is the right way to deal with it. My system is set up to use "burst mode" to query EC (debug.acpi.ec.burst=3D1 in sysctl.conf, and reverting back to burst=3D0 on shutdown to prevent soft reset instead of normal shutdown). After described event occurs, system also sets "debug.acpi.ec.polled" to 1. But, as I understand, laptop's BIOS doesn't support operating in polled mode. If I manually set debug.acpi.ec.polled back to 0, problem goes away -- I can query battery status as before! I've slightly patched sys/dev/acpi/acpi_ec.c (patch is attached) to add new sysctl OID "debeg.acpi.ec.disable_polling". Setting it to 1 prevents going to polled mode. I set it from /etc/sysctl.conf on boot. Now I have no problems with battery status (and other EC interaction, as I guess). I hope someone will find this patch useful, or will have some suggestions how to do it better. P.S. I'm running FreeBSD 7.1-STABLE i386, system dmesg may be found here: http://dl.kibab.com/dell_vostro_1310_A12_dmesg.log --=20 Ilya Bakulin xmpp://kibab612@jabber.ru --=-9IEzOQBN4p+R9MZFrs6a Content-Disposition: attachment; filename="acpi_ec_addon.diff" Content-Type: text/x-patch; name="acpi_ec_addon.diff"; charset="KOI8-R" Content-Transfer-Encoding: base64 LS0tIC91c3Ivc3JjL3N5cy9kZXYvYWNwaWNhL2FjcGlfZWMuYy5vcmlnCTIwMDktMDEtMjAgMDc6 NDA6MTEuMDAwMDAwMDAwICswMzAwDQorKysgL3Vzci9zcmMvc3lzL2Rldi9hY3BpY2EvYWNwaV9l Yy5jCTIwMDktMDEtMjAgMDc6NDc6MDEuMDAwMDAwMDAwICswMzAwDQpAQCAtMTk1LDYgKzE5NSwx MCBAQA0KIFNZU0NUTF9JTlQoX2RlYnVnX2FjcGlfZWMsIE9JRF9BVVRPLCB0aW1lb3V0LCBDVExG TEFHX1JXLCAmZWNfdGltZW91dCwNCiAgICAgRUNfVElNRU9VVCwgIlRvdGFsIHRpbWUgc3BlbnQg d2FpdGluZyBmb3IgYSByZXNwb25zZSAocG9sbCtzbGVlcCkiKTsNCiANCitzdGF0aWMgaW50CWVj X2Rpc2FibGVfcG9sbGluZzsNCitTWVNDVExfSU5UKF9kZWJ1Z19hY3BpX2VjLCBPSURfQVVUTywg ZGlzYWJsZV9wb2xsaW5nLCBDVExGTEFHX1JXLCAmZWNfZGlzYWJsZV9wb2xsaW5nLCAwLA0KKyAg ICAiVG90YWxseSBkaXNhYmxlIHVzZSBvZiBwb2xsZWQgbW9kZSAoRGVsbCBFQyBwcm9ibGVtIHdv cmthcm91bmQpIik7DQorDQogc3RhdGljIEFDUElfU1RBVFVTDQogRWNMb2NrKHN0cnVjdCBhY3Bp X2VjX3NvZnRjICpzYykNCiB7DQpAQCAtODkyLDcgKzg5NiwxMSBAQA0KIAkgICAgZGV2aWNlX3By aW50ZihzYy0+ZWNfZGV2LA0KIAkJIndhaXQgdGltZWQgb3V0ICglc3Jlc3BvbnNlKSwgZm9yY2lu ZyBwb2xsZWQgbW9kZVxuIiwNCiAJCVN0YXR1cyA9PSBBRV9PSyA/ICIiIDogIm5vICIpOw0KLQkg ICAgZWNfcG9sbGVkX21vZGUgPSBUUlVFOw0KKwkgICAgaWYgKGVjX2Rpc2FibGVfcG9sbGluZykg ew0KKwkJZGV2aWNlX3ByaW50ZihzYy0+ZWNfZGV2LCAiUG9sbGluZyBleHBsaWNpdGx5IGRpc2Fi bGVkISBDb250aW51ZSB3YWl0aW5nIGZvciBnZW5lcmF0ZWQgR1BFcy4uLlxuIik7DQorCSAgICB9 IGVsc2Ugew0KKwkJZWNfcG9sbGVkX21vZGUgPSBUUlVFOw0KKwkgICAgfQ0KIAl9DQogICAgIH0N CiAgICAgaWYgKFN0YXR1cyAhPSBBRV9PSykNCg== --=-9IEzOQBN4p+R9MZFrs6a-- --=-HtyI8ZXFqPJSego7sc22 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: =?koi8-r?Q?=FC=D4=C1?= =?koi8-r?Q?_=DE=C1=D3=D4=D8?= =?koi8-r?Q?_=D3=CF=CF=C2=DD=C5=CE=C9=D1?= =?koi8-r?Q?_=D0=CF=C4=D0=C9=D3=C1=CE=C1?= =?koi8-r?Q?_=C3=C9=C6=D2=CF=D7=CF=CA?= =?koi8-r?Q?_=D0=CF=C4=D0=C9=D3=D8=C0?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEABECAAYFAkl8JzwACgkQo9vlj1oadwg8ZgCg1LEcYN+gc9Hlin/teRI2YMXL tFQAn0wvzqM+6Z+5/cqBlFCY0Kxb9V7i =auov -----END PGP SIGNATURE----- --=-HtyI8ZXFqPJSego7sc22-- --DSPAM_MULTIPART_EX-96700 Content-Type: text/plain X-DSPAM-Signature: 497c2736967001885613896 !DSPAM:497c2736967001885613896! --DSPAM_MULTIPART_EX-96700--