Subject: Re: Issue with envsys2 (and formerly with apm@acpi)
To: Juan RP <juan@xtrarom.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 07/31/2007 02:25:55
--9b/uWrIH8C2V3aH3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 29, 2007 at 04:03:28PM +0200, Juan RP wrote:
> On Sun, 29 Jul 2007 06:00:09 +0200
> Quentin Garnier <cube@cubidou.net> wrote:
>=20
> > Hi,
> >=20
> > I've spent most of the last 24 hours tracking a bug that made envstat(8)
> > show bogus values for the status of my battery.
> >=20
> > (Very) long story short, the reason for that behaviour is that the
> > sensors from acpi_bat(4) and acpi_acad(4) (and maybe acpi_tz(4), too)
> > are queried before interrupts are enabled.
> >=20
> > I haven't finished tracking exactly why they need interrupts, but I
> > guess the ACPI embedded controller kind of reports back to the driver
> > at this point, and when that reporting fails, I end up with bogus
> > values.
> >=20
> > Initially I only config_interrupts()'d the envsys attachment for
> > acpi_bat(4) and it wasn't enough, so I did the same for acpi_acad(4)
> > and acpi_tz(4), and now it just works.
> >=20
> > I'm wondering if other people are in a similar situation, and whether
> > or not we should accept that kind of requirement from an ACPI
> > implementation, and of course, if we should comply.
> >=20
> > While deferring the attachment to envsys(9) is very easy to do and not
> > really meaningless, it obviously break apm@acpi, and I don't see an easy
> > way of working around that.  Not that I care a lot about that hack,
> > though.  Besides, I lost a lot of time because of it.
>=20
> I committed a fix for sysmon_envsys(9), please try with the latest
> sysmon_envsys.c (rev 1.45).

Not sure if I would call that a fix, but it does the job.  If you can
work without, why were you calling the update function at that point?

In any case, thanks.  I wish I knew why the laptop behaves that way,
though.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

--9b/uWrIH8C2V3aH3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBRq6Bk9goQloHrPnoAQIy4QgAhIH9V+SET2UpkrgPlYpGb8mpTRmKUSFc
W1o+13wmRD/9MsUCUYlL5+tp0MQ63mQ/tp5H7QntscQTNH/kaFcFYtSP+NpSPDAA
Xu3rIV08XuLE3ytrSuF4vTv6Tx/YckkEXoPZC0nzan0feG1cScwpMQuneViyuhoB
YCeI+fQD1XCGji2cP7NctliKGuNissRQFFTaY9VgxKoUbi14zw+3+7vH7mCEhF69
/XVF/MJPf3WGpsbgqPob9pfDT7bfniFHDAnM1jeIN36WStLRg+evBYMVe/vOQvCg
Wz06nx/cQcF/DKuTUIsn/69JtDjr6Ed8+HV11skUH7LohOTtlCmHtg==
=4ikn
-----END PGP SIGNATURE-----

--9b/uWrIH8C2V3aH3--