Subject: Re: Issue with envsys2 (and formerly with apm@acpi)
To: Quentin Garnier <>
From: Juan RP <>
List: tech-kern
Date: 07/29/2007 16:03:28
On Sun, 29 Jul 2007 06:00:09 +0200
Quentin Garnier <> wrote:

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

I committed a fix for sysmon_envsys(9), please try with the latest
sysmon_envsys.c (rev 1.45).

Juan Romero Pardines	- The NetBSD Project	- NetBSD/pkgsrc news in Spanish