Hi,

My X1 still endures an ACPI storm if I use an external displayport
display.

Previously I posted a workaround that just made acpi_gpe() a no-op for
GPE 111. That solved it for me, but is not the right way of course.

I was looking at acpi_ev_gpe_dispatch() in Linux and noticed it does a
conditonal re-enable.

This version is a bit more subtle: do evaluate, just do not re-enable
for GPE 111.

Maybe I'm on to something? The printed type value is always 0
(AML_OBJTYPE_UNINITIALIZED), though, so I cannot base any decicison on
the value.

        -Otto

Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.371
diff -u -p -r1.371 acpi.c
--- acpi.c      2 Jul 2019 21:17:24 -0000       1.371
+++ acpi.c      23 Aug 2019 13:01:50 -0000
@@ -2294,10 +2294,18 @@ acpi_gpe(struct acpi_softc *sc, int gpe,
 {
        struct aml_node *node = arg;
        uint8_t mask, en;
+       int ret;
+       struct aml_value         res;
 
        dnprintf(10, "handling GPE %.2x\n", gpe);
-       aml_evalnode(sc, node, 0, NULL, NULL);
+       ret = aml_evalnode(sc, node, 0, NULL, &res);
 
+       printf("GPE %d ret %x %d\n", gpe, ret, res.type);
+       if (res.type == AML_OBJTYPE_INTEGER)
+               printf("Value is %llx\n", (long long)res.v_integer);
+       aml_freevalue(&res);
+       if (gpe == 111)
+               return 0;
        mask = (1L << (gpe & 7));
        if (sc->gpe_table[gpe].flags & GPE_LEVEL)
                acpi_write_pmreg(sc, ACPIREG_GPE_STS, gpe>>3, mask);

Reply via email to