Module Name:    src
Committed By:   jdolecek
Date:           Mon Jun 15 15:29:46 UTC 2020

Modified Files:
        src/sys/dev/acpi: acpi_ec.c

Log Message:
only install space handler and enable interrupt for EC if ACPI
claims the device is actually present, it's not enough when there
is entry for it in the ACPI tables

fixes interrupt storm triggered on Dell PowerEdge R220 by enabling
GPE interrupt on a non-enabled EC (for which _REG call later
fails), reported and fix tested by Dima Veselov:
http://mail-index.netbsd.org/netbsd-users/2020/03/02/msg024166.html

XXX pullup netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/acpi/acpi_ec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_ec.c
diff -u src/sys/dev/acpi/acpi_ec.c:1.83 src/sys/dev/acpi/acpi_ec.c:1.84
--- src/sys/dev/acpi/acpi_ec.c:1.83	Mon May  4 20:06:38 2020
+++ src/sys/dev/acpi/acpi_ec.c	Mon Jun 15 15:29:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_ec.c,v 1.83 2020/05/04 20:06:38 jdolecek Exp $	*/
+/*	$NetBSD: acpi_ec.c,v 1.84 2020/06/15 15:29:46 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <jo...@netbsd.org>.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.83 2020/05/04 20:06:38 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.84 2020/06/15 15:29:46 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -268,6 +268,11 @@ acpiec_attach(device_t parent, device_t 
 		goto fail0;
 	}
 
+	if (!acpi_device_present(aa->aa_node->ad_handle)) {
+		aprint_normal(": not present\n");
+		goto fail0;
+	}
+
 	if (!acpiec_parse_gpe_package(self, aa->aa_node->ad_handle,
 				      &gpe_handle, &gpebit))
 		goto fail0;

Reply via email to