Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2011 23:08:51 -0400
From:      Eric McCorkle <eric@shadowsun.net>
To:        freebsd-acpi@freebsd.org, freebsd-current@freebsd.org
Subject:   ACPI battery problem and solution
Message-ID:  <4E7803C3.4080406@shadowsun.net>

next in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E7803C3.4080406>