summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-09-16 20:16:07 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-09-16 20:16:07 +0000
commit9c96bfe773c0e7091b7dcec7a3daf35a28800190 (patch)
tree8190774caeea2391055169e06f9a4c2402b104a6 /sys/dev
parentc0a1aaca8aa18297ad057eae9f21a8999ad4cfba (diff)
Suppress debugging output about CSD entries that say nothing we care about
and improve the output for those we might. output examples from mikeb@ ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpicpu.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index dc5e5329f2c..1a9bc4ae67d 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.76 2016/09/02 13:59:51 pirofti Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.77 2016/09/16 20:16:06 guenther Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -94,6 +94,10 @@ void acpicpu_setperf_ppc_change(struct acpicpu_pss *, int);
#define ACPI_MAX_C2_LATENCY 100
#define ACPI_MAX_C3_LATENCY 1000
+#define CSD_COORD_SW_ALL 0xFC
+#define CSD_COORD_SW_ANY 0xFD
+#define CSD_COORD_HW_ALL 0xFE
+
/* Make sure throttling bits are valid,a=addr,o=offset,w=width */
#define valid_throttle(o,w,a) (a && w && (o+w)<=31 && (o>4 || (o+w)<=4))
@@ -467,21 +471,36 @@ acpicpu_add_cstatepkg(struct aml_value *val, void *arg)
void
acpicpu_add_cdeppkg(struct aml_value *val, void *arg)
{
+ int64_t num_proc, coord_type, domain, cindex;
+
+ /*
+ * errors: unexpected object type, bad length, mismatched length,
+ * and bad CSD revision
+ */
+ if (val->type != AML_OBJTYPE_PACKAGE || val->length < 6 ||
+ val->length != val->v_package[0]->v_integer ||
+ val->v_package[1]->v_integer != 0) {
#if 1 || defined(ACPI_DEBUG) && !defined(SMALL_KERNEL)
- aml_showvalue(val);
+ aml_showvalue(val);
#endif
- if (val->type != AML_OBJTYPE_PACKAGE || val->length < 6 ||
- val->length != val->v_package[0]->v_integer) {
printf("bogus CSD\n");
return;
}
- printf("\nCSD r=%lld d=%lld c=%llx n=%lld i=%lli\n",
- val->v_package[1]->v_integer,
- val->v_package[2]->v_integer,
- val->v_package[3]->v_integer,
- val->v_package[4]->v_integer,
- val->v_package[5]->v_integer);
+ /* coordinating 'among' one CPU is trivial, ignore */
+ num_proc = val->v_package[4]->v_integer;
+ if (num_proc == 1)
+ return;
+
+ /* we practically assume the hardware will coordinate, so ignore */
+ coord_type = val->v_package[3]->v_integer;
+ if (coord_type == CSD_COORD_HW_ALL)
+ return;
+
+ domain = val->v_package[2]->v_integer;
+ cindex = val->v_package[5]->v_integer;
+ printf("\nCSD c=%#llx d=%lld n=%lld i=%lli\n",
+ coord_type, domain, num_proc, cindex);
}
int