From: kettenis Date: Tue, 2 Jul 2024 08:27:04 +0000 (+0000) Subject: Do not attach acpitz(4) if the _STA method indicates that a thermal zone X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=26a40d9e37747a58e21e4c9ff3865c199d9d9c6f;p=openbsd Do not attach acpitz(4) if the _STA method indicates that a thermal zone isn't present. While it isn't clear whether _STA applies to thermal zones according to the ACPI standard, this prevents issues on the Asus Vivobook S15. ok miod@, patrick@, deraadt@ --- diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b7b0fd59bdb..82098deebb3 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.432 2024/06/25 11:57:10 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.433 2024/07/02 08:27:04 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2203,6 +2203,7 @@ acpi_add_device(struct aml_node *node, void *arg) CPU_INFO_ITERATOR cii; struct cpu_info *ci; int proc_id = -1; + int64_t sta; memset(&aaa, 0, sizeof(aaa)); aaa.aaa_node = node; @@ -2233,6 +2234,10 @@ acpi_add_device(struct aml_node *node, void *arg) aaa.aaa_name = "acpicpu"; break; case AML_OBJTYPE_THERMZONE: + sta = acpi_getsta(sc, node); + if ((sta & STA_PRESENT) == 0) + return 0; + aaa.aaa_name = "acpitz"; break; case AML_OBJTYPE_POWERRSRC: