Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/acpi Reset APERF and MPERF only after interrupt...



details:   https://anonhg.NetBSD.org/src/rev/ef9aa51d3377
branches:  trunk
changeset: 763541:ef9aa51d3377
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu Mar 24 11:52:53 2011 +0000

description:
Reset APERF and MPERF only after interrupts have been enabled.

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diffs (59 lines):

diff -r f0de78b1d707 -r ef9aa51d3377 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Thu Mar 24 07:37:04 2011 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Thu Mar 24 11:52:53 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.56 2011/03/24 05:10:05 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.57 2011/03/24 11:52:53 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.56 2011/03/24 05:10:05 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.57 2011/03/24 11:52:53 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -475,6 +475,16 @@
 int
 acpicpu_md_pstate_start(struct acpicpu_softc *sc)
 {
+       uint64_t xc;
+
+       /*
+        * Reset the APERF and MPERF counters.
+        */
+       if ((sc->sc_flags & ACPICPU_FLAG_P_HWF) != 0) {
+               xc = xc_broadcast(0, acpicpu_md_pstate_hwf_reset, NULL, NULL);
+               xc_wait(xc);
+       }
+
        return acpicpu_md_pstate_sysctl_init();
 }
 
@@ -493,7 +503,7 @@
        struct cpu_info *ci = sc->sc_ci;
        struct acpicpu_pstate *ps, msr;
        uint32_t family, i = 0;
-       uint64_t val, xc;
+       uint64_t val;
 
        (void)memset(&msr, 0, sizeof(struct acpicpu_pstate));
 
@@ -616,14 +626,6 @@
                i++;
        }
 
-       /*
-        * Reset the APERF and MPERF counters.
-        */
-       if ((sc->sc_flags & ACPICPU_FLAG_P_HWF) != 0) {
-               xc = xc_unicast(0, acpicpu_md_pstate_hwf_reset, sc, NULL, ci);
-               xc_wait(xc);
-       }
-
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index