> Date: Sat, 8 Oct 2022 16:36:09 +0300
> From: Mikhail <mp39...@gmail.com>
> 
> On Sat, Oct 08, 2022 at 02:56:18PM +0200, Mark Kettenis wrote:
> > The patch isn't quite right, but you're on the right track here.  Can
> > you send me the contents of /var/db/acpi for this machine?
> > Alternatively you can use sendbug(1), which will create a report with
> > all the necessary information attached.
> 
> Yeah, I should have 'tog blame' the file, the commit explains the
> decision for such var assignment.
> 
> ACPI stuff has been sent in direct mail.

Does the diff below work?


Index: dev/acpi/acpiec.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v
retrieving revision 1.65
diff -u -p -r1.65 acpiec.c
--- dev/acpi/acpiec.c   10 Aug 2022 16:58:16 -0000      1.65
+++ dev/acpi/acpiec.c   8 Oct 2022 15:09:17 -0000
@@ -275,17 +275,19 @@ acpiec_attach(struct device *parent, str
        struct acpiec_softc     *sc = (struct acpiec_softc *)self;
        struct acpi_attach_args *aa = aux;
        struct aml_value res;
-       int64_t st;
+       int64_t sta;
 
        sc->sc_acpi = (struct acpi_softc *)parent;
        sc->sc_devnode = aa->aaa_node;
        sc->sc_cantburst = 0;
 
-       if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "_STA", 0, NULL, &st))
-               st = STA_PRESENT | STA_ENABLED | STA_DEV_OK;
-       if ((st & STA_PRESENT) == 0) {
-               printf(": not present\n");
-               return;
+       if (sc->sc_devnode) {
+               sta = acpi_getsta(sc->sc_acpi, sc->sc_devnode);
+               if ((sta & (STA_PRESENT | STA_ENABLED | STA_DEV_OK)) !=
+                   (STA_PRESENT | STA_ENABLED | STA_DEV_OK)) {
+                       printf(": not present\n");
+                       return;
+               }
        }
 
        printf("\n");

Reply via email to