summaryrefslogtreecommitdiff
path: root/sys/arch/hp300
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-08-25 20:57:39 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-08-25 20:57:39 +0000
commitf5006eba1c3736a687553bccba1f67cc6d21fb18 (patch)
tree1ac5b721304d3b92b4612020a1db04f3065869f1 /sys/arch/hp300
parent083bfd4c01889922f02a2c7995429793e274b381 (diff)
Set SCMD_PAD in non-integral sector DMA transfers, or the transfer never
completes; from the old driver, forgotten during the replacement here.
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r--sys/arch/hp300/dev/spc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arch/hp300/dev/spc.c b/sys/arch/hp300/dev/spc.c
index be2ad639bd8..dc04a869107 100644
--- a/sys/arch/hp300/dev/spc.c
+++ b/sys/arch/hp300/dev/spc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spc.c,v 1.5 2004/08/21 18:01:55 miod Exp $ */
+/* $OpenBSD: spc.c,v 1.6 2004/08/25 20:57:38 miod Exp $ */
/* $NetBSD: spc.c,v 1.2 2003/11/17 14:37:59 tsutsui Exp $ */
/*
@@ -212,6 +212,21 @@ spc_dio_dmago(void *arg)
cmd = SCMD_XFR;
len = sc->sc_dleft;
+ if ((len & (DEV_BSIZE -1)) != 0) {
+ cmd |= SCMD_PAD;
+#if 0
+ /*
+ * XXX - If we don't do this, the last 2 or 4 bytes
+ * (depending on word/lword DMA) of a read get trashed.
+ * It looks like it is necessary for the DMA to complete
+ * before the SPC goes into "pad mode"??? Note: if we
+ * also do this on a write, the request never completes.
+ */
+ if ((dsc->sc_dflags & SCSI_DATAIN) != 0)
+ len += 2;
+#endif
+ }
+
spc_write(TCH, len >> 16);
spc_write(TCM, len >> 8);
spc_write(TCL, len);