Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Add comments and raise the minimum allowed T-st...



details:   https://anonhg.NetBSD.org/src/rev/f76ad13ad43f
branches:  trunk
changeset: 757114:f76ad13ad43f
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Aug 15 08:53:19 2010 +0000

description:
Add comments and raise the minimum allowed T-state duty cycle to 10 %.

diffstat:

 sys/dev/acpi/acpi_cpu_cstate.c |  10 +++++++---
 sys/dev/acpi/acpi_cpu_tstate.c |  13 ++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r e5a9909f6f30 -r f76ad13ad43f sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c    Sun Aug 15 08:45:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c    Sun Aug 15 08:53:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.27 2010/08/14 17:27:34 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.28 2010/08/15 08:53:19 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_cstate.c,v 1.27 2010/08/14 17:27:34 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.28 2010/08/15 08:53:19 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -568,7 +568,6 @@
        /*
         * The P_BLK length should always be 6. If it
         * is not, reduce functionality accordingly.
-        * Sanity check also FADT's latency levels.
         */
        if (sc->sc_object.ao_pblklen < 5)
                cs[ACPI_STATE_C2].cs_method = 0;
@@ -576,6 +575,11 @@
        if (sc->sc_object.ao_pblklen < 6)
                cs[ACPI_STATE_C3].cs_method = 0;
 
+       /*
+        * Sanity check the latency levels in FADT.
+        * Values above the thresholds are used to
+        * inform that C-states are not supported.
+        */
        CTASSERT(ACPICPU_C_C2_LATENCY_MAX == 100);
        CTASSERT(ACPICPU_C_C3_LATENCY_MAX == 1000);
 
diff -r e5a9909f6f30 -r f76ad13ad43f sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c    Sun Aug 15 08:45:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c    Sun Aug 15 08:53:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.8 2010/08/15 04:35:16 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.9 2010/08/15 08:53:19 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.8 2010/08/15 04:35:16 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.9 2010/08/15 08:53:19 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -399,7 +399,10 @@
        for (i = 0; i < 5; i++, p++)
                *p = val[i];
 
-        if (ts->ts_percent < 1 || ts->ts_percent > 100)
+       /*
+        * The minimum should be around 100 / 8 = 12.5 %.
+        */
+        if (ts->ts_percent < 10 || ts->ts_percent > 100)
                return AE_BAD_DECIMAL_CONSTANT;
 
        if (ts->ts_latency < 1)
@@ -519,6 +522,10 @@
        if (sc->sc_object.ao_pblkaddr == 0)
                return AE_AML_ILLEGAL_ADDRESS;
 
+       /*
+        * A zero DUTY_WIDTH is used announce that
+        * T-states are not available via FADT.
+        */
        if (width == 0 || width + offset > 4)
                return AE_AML_BAD_RESOURCE_VALUE;
 



Home | Main Index | Thread Index | Old Index