summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2009-01-29 22:15:27 +0000
committermiod <miod@openbsd.org>2009-01-29 22:15:27 +0000
commitb008331a7be6bea6e21f675260adfb7e0d44f63e (patch)
treeb754630fe05f7834a438c422297db5380467c0bd
parentUpdate to reflect renaming of the st_[acm]timespec members to st_[acm]tim (diff)
downloadwireguard-openbsd-b008331a7be6bea6e21f675260adfb7e0d44f63e.tar.xz
wireguard-openbsd-b008331a7be6bea6e21f675260adfb7e0d44f63e.zip
The ``flush before inval'' 88410 workaround needs to be done in
m88410_initialize_cpu() as well. Since we can't flush unknown data, just make sure all 88410 lines are filled with valid data before flushing it. This should fix the spurious ``197DP hangs or loops on osiop errors after autoconf'' issue I've been seeing.
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index 8dccf534f16..cc0a77d8606 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.58 2008/01/02 19:59:31 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.59 2009/01/29 22:15:27 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* All rights reserved.
@@ -352,7 +352,35 @@ m88410_initialize_cpu(cpuid_t cpu)
dctl |= CMMU_DCTL_SEN;
set_dctl(dctl);
CMMU_LOCK;
+#if 0
mc88410_inval(); /* clear external data cache */
+#else
+ /*
+ * We can't invalidate the 88410 cache without flushing it first;
+ * this is probably due to either an error in the cpu-to-88410
+ * communication protocol, or to a bug in the '410 (but since I
+ * do not know how to get its revision, I can't tell whether this
+ * is the obscure v1 bug or not).
+ *
+ * Since we can't flush random data either, fill the secondary
+ * cache first, before flushing it.
+ *
+ * The smallest 88410 cache line is 32 bytes, and the largest size
+ * is 1MB.
+ */
+ {
+ vaddr_t va;
+ uint32_t junk = 0;
+
+ for (va = 0; va < 1024 * 1024; va += 32)
+ junk += *(uint32_t *)va;
+
+ /* to make sure the above loop isn't optimized away */
+ mc88110_sync_data_page(junk & PAGE_SIZE);
+ }
+ mc88410_flush();
+ mc88410_inval();
+#endif
CMMU_UNLOCK;
#ifdef MULTIPROCESSOR