From 2f870c4905cb4fa4cc4eb8b75b06101dbd3e027c Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 26 Jan 2022 14:39:08 +0000 Subject: 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@ --- sys/dev/acpi/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpi') 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)) -- cgit v1.2.3