Module Name:    src
Committed By:   snj
Date:           Tue Apr  7 23:28:30 UTC 2009

Modified Files:
        src/sys/arch/x86/pci [netbsd-5]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #669):
        sys/arch/x86/pci/ichlpcib.c: revision 1.16
Restore SpeedStep settings on shutdown. Some BIOSes don't like it, if
SpeedStep is enabled and powerdown fails otherwise. Fixes PR kern/40487.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 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.14 src/sys/arch/x86/pci/ichlpcib.c:1.14.4.1
--- src/sys/arch/x86/pci/ichlpcib.c:1.14	Mon Oct 13 15:10:51 2008
+++ src/sys/arch/x86/pci/ichlpcib.c	Tue Apr  7 23:28:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.14 2008/10/13 15:10:51 joerg Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 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.14 2008/10/13 15:10:51 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 snj Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -86,6 +86,9 @@
 	uint32_t		sc_hpet_reg;
 #endif
 
+	/* Speedstep */
+	pcireg_t		sc_pmcon_orig;
+
 	/* Power management */
 	pcireg_t		sc_pirq[2];
 	pcireg_t		sc_pmcon;
@@ -96,6 +99,7 @@
 static void lpcibattach(device_t, device_t, void *);
 static bool lpcib_suspend(device_t PMF_FN_PROTO);
 static bool lpcib_resume(device_t PMF_FN_PROTO);
+static bool lpcib_shutdown(device_t, int);
 
 static void pmtimer_configure(device_t);
 
@@ -205,6 +209,9 @@
 		return;
 	}
 
+	sc->sc_pmcon_orig = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	    LPCIB_PCI_GEN_PMCON_1);
+
 	/* For ICH6 and later, always enable RCBA */
 	if (sc->sc_has_rcba) {
 		pcireg_t rcba;
@@ -241,11 +248,23 @@
 #endif
 
 	/* Install power handler */
-	if (!pmf_device_register(self, lpcib_suspend, lpcib_resume))
+	if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
+	    lpcib_shutdown))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static bool
+lpcib_shutdown(device_t dv, int howto)
+{
+	struct lpcib_softc *sc = device_private(dv);
+
+	pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	    LPCIB_PCI_GEN_PMCON_1, sc->sc_pmcon_orig);
+
+	return true;
+}
+
+static bool
 lpcib_suspend(device_t dv PMF_FN_ARGS)
 {
 	struct lpcib_softc *sc = device_private(dv);

Reply via email to