Source-Changes-HG archive

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

[src/trunk]: src/sys After discussion with jakllsch@ and jmcneill@, revert th...



details:   https://anonhg.NetBSD.org/src/rev/72c565babd2b
branches:  trunk
changeset: 757264:72c565babd2b
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Aug 21 18:25:45 2010 +0000

description:
After discussion with jakllsch@ and jmcneill@, revert the previous and only
do the status-check when the comparison value reported by BIOS is not zero.
The uncertainty noted in the previous commit still applies. But if we ever
see a timeout again, it will likely be either a firmware bug or a special
case like the Intel Turbo Boost.

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  15 +++++++++------
 sys/dev/acpi/acpi_cpu_tstate.c  |  13 ++-----------
 2 files changed, 11 insertions(+), 17 deletions(-)

diffs (98 lines):

diff -r 3c5548f1d232 -r 72c565babd2b sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Aug 21 17:27:20 2010 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Aug 21 18:25:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.28 2010/08/21 15:37:35 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.29 2010/08/21 18:25:45 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 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.28 2010/08/21 15:37:35 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.29 2010/08/21 18:25:45 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -481,7 +481,7 @@
                if (ps->ps_freq == 0)
                        continue;
 
-               if (val == ps->ps_status || val == ps->ps_control) {
+               if (val == ps->ps_status) {
                        *freq = ps->ps_freq;
                        return 0;
                }
@@ -509,6 +509,9 @@
        xc = xc_broadcast(0, (xcfunc_t)x86_msr_xcall, &msr, NULL);
        xc_wait(xc);
 
+       if (__predict_false(ps->ps_status == 0))
+               return 0;
+
        if (__predict_false(ps->ps_status_addr == 0))
                return 0;
 
@@ -535,7 +538,7 @@
                if (__predict_true(ps->ps_status_mask != 0))
                        val = val & ps->ps_status_mask;
 
-               if (val == ps->ps_status || val == ps->ps_control)
+               if (val == ps->ps_status)
                        return;
 
                DELAY(ps->ps_latency);
@@ -560,7 +563,7 @@
                if (ts->ts_percent == 0)
                        continue;
 
-               if (val == ts->ts_status || val == ts->ts_control) {
+               if (val == ts->ts_status) {
                        *percent = ts->ts_percent;
                        return 0;
                }
@@ -604,7 +607,7 @@
 
                val = rdmsr(MSR_THERM_CONTROL);
 
-               if (val == ts->ts_status || val == ts->ts_control)
+               if (val == ts->ts_status)
                        return;
 
                DELAY(ts->ts_latency);
diff -r 3c5548f1d232 -r 72c565babd2b sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c    Sat Aug 21 17:27:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c    Sat Aug 21 18:25:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.15 2010/08/20 04:16:00 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.16 2010/08/21 18:25:45 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.15 2010/08/20 04:16:00 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.16 2010/08/21 18:25:45 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -683,15 +683,6 @@
                        if (sc->sc_tstate[i].ts_percent == 0)
                                continue;
 
-                       /*
-                        * As the status field may be zero, compare
-                        * against the control field value as well.
-                        */
-                       if (val == sc->sc_tstate[i].ts_control) {
-                               ts = &sc->sc_tstate[i];
-                               break;
-                       }
-
                        if (val == sc->sc_tstate[i].ts_status) {
                                ts = &sc->sc_tstate[i];
                                break;



Home | Main Index | Thread Index | Old Index