Module Name: src Committed By: snj Date: Sun Aug 28 03:38:15 UTC 2016
Modified Files: src/sys/arch/x86/pci [netbsd-7]: ichlpcib.c Log Message: Pull up following revision(s) (requested by maya in ticket #1213): sys/arch/x86/pci/ichlpcib.c: revision 1.51 Disable gpio(4) attachment to ichlpcib(4) by default. The GPIO lines on an ICH are usually connected to opaque platform- defined functionality, and may be manipulated by the ACPI DSDT or other mechanisms behind our backs. In one instance, it was found this in combiation with gpio_resume() sabotaged repeated suspend/resume cycles. GPIO functionality can be enabled by setting ichlpcib_gpio_disable to 0, for instance with `gdb -write`. To generate a diff of this commit: cvs rdiff -u -r1.43.4.4 -r1.43.4.5 src/sys/arch/x86/pci/ichlpcib.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/arch/x86/pci/ichlpcib.c diff -u src/sys/arch/x86/pci/ichlpcib.c:1.43.4.4 src/sys/arch/x86/pci/ichlpcib.c:1.43.4.5 --- src/sys/arch/x86/pci/ichlpcib.c:1.43.4.4 Thu Apr 30 19:27:20 2015 +++ src/sys/arch/x86/pci/ichlpcib.c Sun Aug 28 03:38:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ichlpcib.c,v 1.43.4.4 2015/04/30 19:27:20 snj Exp $ */ +/* $NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.4 2015/04/30 19:27:20 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -279,6 +279,14 @@ static struct lpcib_device { }; /* + * Allow user to enable GPIO functionality if they really need it. The + * vast majority of systems with an ICH should not expose GPIO to the + * kernel or user. In at least one instance the gpio_resume() handler + * on ICH GPIO was found to sabotage S3 suspend/resume. + */ +int ichlpcib_gpio_disable = 1; + +/* * Autoconf callbacks. */ static int @@ -1073,6 +1081,9 @@ lpcib_gpio_configure(device_t self) int pin, shift, base_reg, cntl_reg, reg; int rv; + if (ichlpcib_gpio_disable != 0) + return; + /* this implies ICH >= 6, and thus different mapreg */ if (sc->sc_has_rcba) { base_reg = LPCIB_PCI_GPIO_BASE_ICH6;