summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2022-07-20 15:45:28 +0000
committerthorpej <thorpej@NetBSD.org>2022-07-20 15:45:28 +0000
commit2e33f394a09bfe78f10cfe34d094e0f16caac39d (patch)
treee46dbbfc9bb9b81fa056857feb5dfaa7838f6bd9 /sys
parentac0732ab34e76569641fed1be40af249389835d0 (diff)
In the Alpha tc_syncbus(), we need to issue a MB because WMB does not
order reads with respect to writes. Remove now-redundant tc_wmb() calls before tc_syncbus(). NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed by tc_syncbus()).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/include/tc_machdep.h7
-rw-r--r--sys/dev/tc/pxg.c6
-rw-r--r--sys/dev/tc/stic.c8
3 files changed, 10 insertions, 11 deletions
diff --git a/sys/arch/alpha/include/tc_machdep.h b/sys/arch/alpha/include/tc_machdep.h
index c0d91cceb77..6b762a99389 100644
--- a/sys/arch/alpha/include/tc_machdep.h
+++ b/sys/arch/alpha/include/tc_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_machdep.h,v 1.7 2017/06/22 16:46:52 flxd Exp $ */
+/* $NetBSD: tc_machdep.h,v 1.8 2022/07/20 15:45:28 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -71,6 +71,11 @@ typedef int32_t tc_offset_t;
#define tc_syncbus() \
do { \
volatile uint32_t no_optimize; \
+ /* \
+ * WMB does not order reads with respect to writes, so a \
+ * MB is required here. \
+ */ \
+ alpha_mb(); \
no_optimize = \
*(volatile uint32_t *)ALPHA_PHYS_TO_K0SEG(0x00000001f0080220); \
__USE(no_optimize); \
diff --git a/sys/dev/tc/pxg.c b/sys/dev/tc/pxg.c
index 7133a7a5412..3e7ae186a0c 100644
--- a/sys/dev/tc/pxg.c
+++ b/sys/dev/tc/pxg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pxg.c,v 1.36 2019/11/10 21:16:37 chs Exp $ */
+/* $NetBSD: pxg.c,v 1.37 2022/07/20 15:45:28 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.36 2019/11/10 21:16:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.37 2022/07/20 15:45:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -164,7 +164,6 @@ pxg_attach(device_t parent, device_t self, void *aux)
/* Start the i860. */
si->si_slotbase[PXG_I860_START_OFFSET >> 2] = 1;
- tc_wmb();
tc_syncbus();
DELAY(40000);
#endif
@@ -208,7 +207,6 @@ pxg_init(struct stic_info *si)
slot[PXG_I860_RESET_OFFSET >> 2] = 0;
tc_wmb();
slot[PXG_HOST_INTR_OFFSET >> 2] = 0;
- tc_wmb();
tc_syncbus();
DELAY(40000);
diff --git a/sys/dev/tc/stic.c b/sys/dev/tc/stic.c
index 289ed4a4907..bdf866819a8 100644
--- a/sys/dev/tc/stic.c
+++ b/sys/dev/tc/stic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stic.c,v 1.58 2022/05/18 13:56:32 andvar Exp $ */
+/* $NetBSD: stic.c,v 1.59 2022/07/20 15:45:28 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.58 2022/05/18 13:56:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.59 2022/07/20 15:45:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -288,7 +288,6 @@ stic_init(struct stic_info *si)
/* Now reset the VDAC. */
*si->si_vdac_reset = 0;
- tc_wmb();
tc_syncbus();
DELAY(1000);
@@ -358,13 +357,11 @@ stic_reset(struct stic_info *si)
* Initialize the interface chip registers.
*/
sr->sr_sticsr = 0x00000030; /* Get the STIC's attention. */
- tc_wmb();
tc_syncbus();
DELAY(2000); /* wait 2ms for STIC to respond. */
sr->sr_sticsr = 0x00000000; /* Hit the STIC's csr again... */
tc_wmb();
sr->sr_buscsr = 0xffffffff; /* and bash its bus-access csr. */
- tc_wmb();
tc_syncbus(); /* Blam! */
DELAY(20000); /* wait until the stic recovers... */
@@ -402,7 +399,6 @@ stic_reset(struct stic_info *si)
sr->sr_ipdvint =
STIC_INT_WE | STIC_INT_P | STIC_INT_E_EN | STIC_INT_V_EN;
sr->sr_sticsr = 8;
- tc_wmb();
tc_syncbus();
}