Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/arch/x86/pci Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/431351aa3b44
branches:  netbsd-7
changeset: 799962:431351aa3b44
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Aug 28 03:38:15 2016 +0000

description:
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`.

diffstat:

 sys/arch/x86/pci/ichlpcib.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r dd9aa1371ed6 -r 431351aa3b44 sys/arch/x86/pci/ichlpcib.c
--- a/sys/arch/x86/pci/ichlpcib.c       Sat Aug 27 15:21:10 2016 +0000
+++ b/sys/arch/x86/pci/ichlpcib.c       Sun Aug 28 03:38:15 2016 +0000
@@ -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 @@
 };
 
 /*
+ * 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 @@
        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;



Home | Main Index | Thread Index | Old Index