Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi As discussed with bouyer@, fix a too eager T-st...



details:   https://anonhg.NetBSD.org/src/rev/a77cfd5bd8cd
branches:  trunk
changeset: 791482:a77cfd5bd8cd
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Nov 20 13:39:59 2013 +0000

description:
As discussed with bouyer@, fix a too eager T-state validation check to
accomodate new Intel CPUs.

diffstat:

 sys/dev/acpi/acpi_cpu_tstate.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 38ba7e3c2fdd -r a77cfd5bd8cd sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c    Wed Nov 20 12:59:21 2013 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c    Wed Nov 20 13:39:59 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.31 2012/04/27 04:38:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.32 2013/11/20 13:39:59 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.31 2012/04/27 04:38:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.32 2013/11/20 13:39:59 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -329,9 +329,14 @@
                *p = val[i];
 
        /*
-        * The minimum should be around 100 / 8 = 12.5 %.
+        * The minimum should be either 12.5 % or 6.5 %,
+        * the latter 4-bit dynamic range being available
+        * in some newer models; see Section 14.5.3.1 in
+        *
+        *      Intel 64 and IA-32 Architectures Software
+        *      Developer's Manual. Volume 3B, Part 2. 2013.
         */
-        if (ts->ts_percent < 10 || ts->ts_percent > 100)
+        if (ts->ts_percent < 6 || ts->ts_percent > 100)
                return AE_BAD_DECIMAL_CONSTANT;
 
        if (ts->ts_latency == 0 || ts->ts_latency > 1000)



Home | Main Index | Thread Index | Old Index