From: kettenis Date: Wed, 26 Jan 2022 14:39:07 +0000 (+0000) Subject: An ACPI device needs to be both present and enabled for it to function. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e0cbaa99ef9f0e613f7dc8c17a746d9b022ecfa2;p=openbsd An ACPI device needs to be both present and enabled for it to function. So only attempt to attach hardware that has both bits enabled. This fixes an issue where com(4) would attach for a disabled serial port leading to misdetection of the hardware variant and a subsequent hang when /etc/rc runs ttyflags -a. ok anton@, deraadt@ --- diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 65b53fbf6ba..dd0c4d1e847 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.405 2022/01/12 11:18:30 patrick Exp $ */ +/* $OpenBSD: acpi.c,v 1.406 2022/01/26 14:39:07 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -3321,7 +3321,7 @@ acpi_foundhid(struct aml_node *node, void *arg) return (0); sta = acpi_getsta(sc, node->parent); - if ((sta & STA_PRESENT) == 0) + if ((sta & (STA_PRESENT | STA_ENABLED)) != (STA_PRESENT | STA_ENABLED)) return (0); if (aml_evalinteger(sc, node->parent, "_CCA", 0, NULL, &cca))