Currently we attach ACPI devices that are present in a machine.
However, in some cases ACPI devices can be present, but not enabled.
Attaching a device driver to devices that are not enabled is not a
good idea since reading and writing from/to its registers will fail
and the driver will malfunction in interesting ways. Such as a com(4)
serial port that is misdetected and hangs the kernel when it is
actually opened.
The diff below makes sure we only enable devices that are actually
enabled. This may cause some devices to disappear in OpenBSD.
However those devices should have been unusable anyway, so that isn't
an issue.
ok?
Index: dev/acpi/acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.405
diff -u -p -r1.405 acpi.c
--- dev/acpi/acpi.c 12 Jan 2022 11:18:30 -0000 1.405
+++ dev/acpi/acpi.c 23 Jan 2022 17:13:03 -0000
@@ -3321,7 +3321,7 @@ acpi_foundhid(struct aml_node *node, voi
return (0);
sta = acpi_getsta(sc, node->parent);
- if ((sta & STA_PRESENT) == 0)
+ if ((sta & STA_ENABLED) == 0)
return (0);
if (aml_evalinteger(sc, node->parent, "_CCA", 0, NULL, &cca))