From owner-freebsd-acpi@FreeBSD.ORG Tue Sep 20 03:35:44 2011 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 29D371065670 for ; Tue, 20 Sep 2011 03:35:44 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id D18258FC1C for ; Tue, 20 Sep 2011 03:35:43 +0000 (UTC) Received: (qmail 29728 invoked from network); 19 Sep 2011 23:09:02 -0400 Received: from c-76-28-30-220.hsd1.ma.comcast.net (HELO ?172.16.0.8?) (76.28.30.220) by mail.atlantawebhost.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 19 Sep 2011 23:09:02 -0400 Message-ID: <4E7803C3.4080406@shadowsun.net> Date: Mon, 19 Sep 2011 23:08:51 -0400 From: Eric McCorkle User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.2) Gecko/20110916 Thunderbird/6.0.2 MIME-Version: 1.0 To: freebsd-acpi@freebsd.org, freebsd-current@freebsd.org X-Enigmail-Version: undefined Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDFA09C09903177A023127134" Cc: Subject: ACPI battery problem and solution 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: Tue, 20 Sep 2011 03:35:44 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDFA09C09903177A023127134 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello, I'm running 9.0-CURRENT on a MacbookPro 5,5. Following a recent update, I found that the acpi battery functionality had stopped working. I suspect, given the nature of it, that other people may have seen this problem as well. I did some work, and traced the problem to its source. The driver (in dev/acpica/acpi_cmbat.c) attempts to dispatch a call to acpi_cmbat_init_battery() via the AcpiOsExecute() mechanism. However, it seemed that the queue was filling up during kernel initialization, and the call was getting dropped on the floor. The cmbat driver reads part of the battery info (the bif structure) into its own structures at initialization, and then uses it, rather than querying the battery directly. Because AcpiOsExecute was dropping the initialization request on the floor, the bif information was left uninitialized, which caused the driver to mistakenly report the battery as not present when queried from sysctl/ioctl. I was able to workaround the problem by setting debug.acpi.max_tasks to a higher value, which restored functionality. Several possible solutions come to mind: 1) keep track of whether or not acpi_cmbat_init_battery (and possibly other initialization routines) have actually been successfully queued and run, to distinguish "genuine" failures, rather than failures resulting from a full queue 2) run acpi_cmbat_init_battery (and possibly other initialization routines) directly, rather than sending them through the queue. 3) something else But I'll leave the decision of what to do up to people with more knowledge of the acpi system. Hope this helps someone. --------------enigDFA09C09903177A023127134 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQIcBAEBAgAGBQJOeAPNAAoJENSCzbQ+koZ72OQQALD2EbbTkbHtcxkzsMHdNVxv /7SLVOzfPjgPgGbWCOz8Cjf0/81Q9bln7fYfnnKhdzf74DYHE384iKgObIgO4o0c Zc0UgbrEyeHetj1k6IJEI7AeY6BXZqeNVNPEeOBIfI4ngM/u/J11v+vvVoN1OPnH VEkfhQmyhODweWUjLIM033fhOhJQErTKSAKnfPzxZI8a4zDKfisRWckIF2vVROjW 3CSnno7yk9EeP4StL4DsdGyPRIRd8XAtVWvdAE8+zM93RqqQrePEYWUtNckIeHYL SsHTfhRNhfZsPhsAMN81GXW2WBH3gxy474shaognfvtUw2dyR9W0l25wcn+vKN3m OxUudUtL/vy37hLiuEEb8FADtpf8ytGQJpN6igYsKuGAhO/RmVnXF9rZ4DcIytAQ 91hbTCkvEEXvpTMhtfKmLeb/JUoMcXvKhOGaZeI4Tu6DfK/nwNYgKd5pOST1LKRA aApLvH2uz/CEd/bE5cYcEQZyx0lMWj4hT6bVL/AIWQmO47Yc1K0Lwo8ZWaXUUDR/ B6uRd834KIL6wBqXYsWhynUZTRzEO4XcBck56A7r8gj8IGEwzTSjTnq0XcULfzrs JT272NrU1Ip9QkQboPFA2VfqQdj4PYq7LSFu1hWAAGby8R3LPOfcoXfCwNwRSS27 KN5YRAs1VRI6W1l0Gd8y =jXcB -----END PGP SIGNATURE----- --------------enigDFA09C09903177A023127134--