Module Name: src Committed By: jruoho Date: Sun Jan 30 08:55:52 UTC 2011
Modified Files: src/sys/dev/acpi: acpi_cpu_cstate.c acpi_cpu_pstate.c acpi_cpu_tstate.c Log Message: Improve error reporting. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/acpi/acpi_cpu_cstate.c \ src/sys/dev/acpi/acpi_cpu_pstate.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/acpi/acpi_cpu_tstate.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/acpi_cpu_cstate.c diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.36 src/sys/dev/acpi/acpi_cpu_cstate.c:1.37 --- src/sys/dev/acpi/acpi_cpu_cstate.c:1.36 Thu Jan 13 03:40:51 2011 +++ src/sys/dev/acpi/acpi_cpu_cstate.c Sun Jan 30 08:55:52 2011 @@ -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 <jruoho...@iki.fi> @@ -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; } Index: src/sys/dev/acpi/acpi_cpu_pstate.c diff -u src/sys/dev/acpi/acpi_cpu_pstate.c:1.36 src/sys/dev/acpi/acpi_cpu_pstate.c:1.37 --- src/sys/dev/acpi/acpi_cpu_pstate.c:1.36 Thu Dec 30 12:05:02 2010 +++ src/sys/dev/acpi/acpi_cpu_pstate.c Sun Jan 30 08:55:52 2011 @@ -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 <jruoho...@iki.fi> @@ -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); Index: src/sys/dev/acpi/acpi_cpu_tstate.c diff -u src/sys/dev/acpi/acpi_cpu_tstate.c:1.18 src/sys/dev/acpi/acpi_cpu_tstate.c:1.19 --- src/sys/dev/acpi/acpi_cpu_tstate.c:1.18 Thu Dec 30 12:05:02 2010 +++ src/sys/dev/acpi/acpi_cpu_tstate.c Sun Jan 30 08:55:52 2011 @@ -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 <jruoho...@iki.fi> @@ -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); }