Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Improve error reporting.



details:   https://anonhg.NetBSD.org/src/rev/6828fbff70a3
branches:  trunk
changeset: 761498:6828fbff70a3
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Jan 30 08:55:52 2011 +0000

description:
Improve error reporting.

diffstat:

 sys/dev/acpi/acpi_cpu_cstate.c |  10 +++++-----
 sys/dev/acpi/acpi_cpu_pstate.c |  32 ++++++++++++++++++++++----------
 sys/dev/acpi/acpi_cpu_tstate.c |   6 +++---
 3 files changed, 30 insertions(+), 18 deletions(-)

diffs (156 lines):

diff -r 7ee28d9294ed -r 6828fbff70a3 sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c    Sun Jan 30 07:04:48 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c    Sun Jan 30 08:55:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.36 2011/01/13 03:40:51 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.37 2011/01/30 08:55:52 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.36 2011/01/13 03:40:51 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.37 2011/01/30 08:55:52 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -142,7 +142,7 @@
                        panic("NOTREACHED");
                }
 
-               aprint_debug_dev(sc->sc_dev, "C%d: %3s, "
+               aprint_verbose_dev(sc->sc_dev, "C%d: %3s, "
                    "lat %3u us, pow %5u mW, flags 0x%02x\n", i, str,
                    cs->cs_latency, cs->cs_power, cs->cs_flags);
        }
@@ -490,8 +490,8 @@
 
 out:
        if (ACPI_FAILURE(rv))
-               aprint_debug_dev(sc->sc_dev, "invalid "
-                   "_CST: %s\n", AcpiFormatException(rv));
+               aprint_error_dev(sc->sc_dev, "failed to add "
+                   "C-state: %s\n", AcpiFormatException(rv));
 
        return rv;
 }
diff -r 7ee28d9294ed -r 6828fbff70a3 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c    Sun Jan 30 07:04:48 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c    Sun Jan 30 08:55:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.36 2010/12/30 12:05:02 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.37 2011/01/30 08:55:52 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.36 2010/12/30 12:05:02 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.37 2011/01/30 08:55:52 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -75,10 +75,16 @@
        }
 
        /*
-        * Append additional information from the
-        * extended _PSS, if available. Note that
-        * XPSS can not be used on Intel systems
-        * that use either _PDC or _OSC.
+        * Append additional information from the extended _PSS,
+        * if available. Note that XPSS can not be used on Intel
+        * systems that use either _PDC or _OSC. From the XPSS
+        * method specification:
+        *
+        *   "The platform must not require the use of the
+        *    optional _PDC or _OSC methods to coordinate
+        *    between the operating system and firmware for
+        *    the purposes of enabling specific processor
+        *    power management features or implementations."
         */
        if (sc->sc_cap == 0) {
 
@@ -134,11 +140,11 @@
                return;
 
        case AE_SUPPORT:
-               aprint_verbose_dev(sc->sc_dev, "P-states not supported\n");
+               aprint_verbose_dev(self, "P-states not supported\n");
                return;
 
        default:
-               aprint_error_dev(sc->sc_dev, "failed to evaluate "
+               aprint_error_dev(self, "failed to evaluate "
                    "%s: %s\n", str, AcpiFormatException(rv));
        }
 }
@@ -164,7 +170,7 @@
                if (ps->ps_freq == 0)
                        continue;
 
-               aprint_debug_dev(sc->sc_dev, "P%d: %3s, "
+               aprint_verbose_dev(sc->sc_dev, "P%d: %3s, "
                    "lat %3u us, pow %5u mW, %4u MHz\n", i, str,
                    ps->ps_latency, ps->ps_power, ps->ps_freq);
        }
@@ -414,6 +420,8 @@
                rv = acpicpu_pstate_pss_add(ps, &obj->Package.Elements[i]);
 
                if (ACPI_FAILURE(rv)) {
+                       aprint_error_dev(sc->sc_dev, "failed to add "
+                           "P-state: %s\n", AcpiFormatException(rv));
                        ps->ps_freq = 0;
                        continue;
                }
@@ -494,7 +502,7 @@
        rv = acpi_eval_struct(sc->sc_node->ad_handle, "XPSS", &buf);
 
        if (ACPI_FAILURE(rv))
-               return rv;
+               goto out;
 
        obj = buf.Pointer;
 
@@ -517,6 +525,10 @@
        }
 
 out:
+       if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND)
+               aprint_error_dev(sc->sc_dev, "failed to evaluate "
+                   "XPSS: %s\n", AcpiFormatException(rv));
+
        if (buf.Pointer != NULL)
                ACPI_FREE(buf.Pointer);
 
diff -r 7ee28d9294ed -r 6828fbff70a3 sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c    Sun Jan 30 07:04:48 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c    Sun Jan 30 08:55:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.18 2010/12/30 12:05:02 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.19 2011/01/30 08:55:52 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.18 2010/12/30 12:05:02 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.19 2011/01/30 08:55:52 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -134,7 +134,7 @@
                if (ts->ts_percent == 0)
                        continue;
 
-               aprint_debug_dev(sc->sc_dev, "T%u: %3s, "
+               aprint_verbose_dev(sc->sc_dev, "T%u: %3s, "
                    "lat %3u us, pow %5u mW, %3u %%\n", i, str,
                    ts->ts_latency, ts->ts_power, ts->ts_percent);
        }



Home | Main Index | Thread Index | Old Index