Subject: Issue with envsys2 (and formerly with apm@acpi)
To: None <tech-kern@netbsd.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 07/29/2007 06:00:09
--CSNFvL6ilyiKL/Hs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

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.

(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.

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.

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.

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.

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.

Thoughts?

--=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.

--CSNFvL6ilyiKL/Hs
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBRqwQydgoQloHrPnoAQL2aAf/SgSfdbXL0KpGsk08Qq+oXAGUChnoF893
klledQB8n+lxoD0uWYHW7mKt4QF4GY9BaUa2K+2h5Dh4MSP39O3AYNRFNJXbp6ni
N7KnQZGuyN1yeo7UvytTSpguR3PIASTT7F5x+g7+ka35VGySAYfnTKy4KJoqVrJt
6LmHyz+NVfHKUvUGinjs6qkJa9AOMuxMTP+WkCKTNLQZ0ZiYcFm7gtURo11ywltI
+QQ+SYryoZ2+XDGzUFj6gB4b0rodA1OmFJKyDwDfkUDAHvf3fJJXJ6LMir97ueis
rZoRaNNCWSxx9r6l9c83fRX0gPI6kO6kljbY3kptSZdLIsINsIK2Og==
=JSFA
-----END PGP SIGNATURE-----

--CSNFvL6ilyiKL/Hs--