Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Do not error out neither in P-states nor in T-s...



details:   https://anonhg.NetBSD.org/src/rev/a0ea24043fd8
branches:  trunk
changeset: 757136:a0ea24043fd8
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Mon Aug 16 04:31:21 2010 +0000

description:
Do not error out neither in P-states nor in T-states if the method for the
dynamic maximum is nonexistent. Unsurprisingly, there is vagueness in the
standards; in ACPI 3.0 and 4.0 it is clearly indicated that also these methods
must be present, but the earlier standards are less stringent. Without too
much effort, at least one old P4-system was located that lacks _PPC.

diffstat:

 sys/dev/acpi/acpi_cpu_pstate.c |  18 ++++++++----------
 sys/dev/acpi/acpi_cpu_tstate.c |  20 ++++++++------------
 2 files changed, 16 insertions(+), 22 deletions(-)

diffs (94 lines):

diff -r 2bb3edf02eeb -r a0ea24043fd8 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c    Mon Aug 16 01:21:10 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c    Mon Aug 16 04:31:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.19 2010/08/14 17:27:34 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.20 2010/08/16 04:31:21 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_pstate.c,v 1.19 2010/08/14 17:27:34 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.20 2010/08/16 04:31:21 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -60,8 +60,11 @@
        ACPI_STATUS rv;
 
        /*
-        * Three control methods are mandatory
-        * for P-states; _PSS, _PCT, and _PPC.
+        * The ACPI 3.0 and 4.0 specifications mandate three
+        * objects for P-states: _PSS, _PCT, and _PPC. A less
+        * strict wording is however used in the earlier 2.0
+        * standard, and some systems conforming to ACPI 2.0
+        * do not have _PPC, the method for dynamic maximum.
         */
        rv = acpicpu_pstate_pss(sc);
 
@@ -77,12 +80,7 @@
                goto fail;
        }
 
-       rv = acpicpu_pstate_max(sc);
-
-       if (rv != 0) {
-               str = "_PPC";
-               goto fail;
-       }
+       (void)acpicpu_pstate_max(sc);
 
        sc->sc_flags |= ACPICPU_FLAG_P;
        sc->sc_pstate_current = sc->sc_pstate[0].ps_freq;
diff -r 2bb3edf02eeb -r a0ea24043fd8 sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c    Mon Aug 16 01:21:10 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c    Mon Aug 16 04:31:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.9 2010/08/15 08:53:19 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.10 2010/08/16 04:31:21 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.9 2010/08/15 08:53:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.10 2010/08/16 04:31:21 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -63,10 +63,6 @@
        if ((sc->sc_flags & ACPICPU_FLAG_PIIX4) != 0)
                return;
 
-       /*
-        * If either _TSS, _PTC, or _TPC is not
-        * available, we have to resort to FADT.
-        */
        rv  = acpicpu_tstate_tss(sc);
 
        if (ACPI_FAILURE(rv)) {
@@ -81,12 +77,12 @@
                goto out;
        }
 
-       rv = acpicpu_tstate_change(sc);
-
-       if (ACPI_FAILURE(rv)) {
-               str = "_TPC";
-               goto out;
-       }
+       /*
+        * Comparable to P-states, the _TPC object may
+        * be absent in some systems, even though it is
+        * required by ACPI 3.0 along with _TSS and _PTC.
+        */
+       (void)acpicpu_tstate_change(sc);
 
 out:
        if (ACPI_FAILURE(rv)) {



Home | Main Index | Thread Index | Old Index