summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsapuntz <csapuntz@openbsd.org>2000-12-19 05:10:06 +0000
committercsapuntz <csapuntz@openbsd.org>2000-12-19 05:10:06 +0000
commitbf07dfc9c48ed8b7bc3006a2a1842aadfd74dec3 (patch)
treede0e6babad0b7331f222d82349a4dd3937f2623e
parentsync with Apache 1.3.14 (diff)
downloadwireguard-openbsd-bf07dfc9c48ed8b7bc3006a2a1842aadfd74dec3.tar.xz
wireguard-openbsd-bf07dfc9c48ed8b7bc3006a2a1842aadfd74dec3.zip
A DMA transfer of 4 bytes was failing to complete correctly
on a combination of VIA South Bridge and old Toshiba drive. DMA transfers of 4 bytes work for my old Mitsumi FX600 drive. Assume Toshiba drive is in error. Avoid situation by only invoking DMA transfers on transfers over 100 bytes. Thanks to Tim Howe for the hardware for testing
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 5743adfff59..348a6413df0 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.33 2000/11/16 08:05:57 niklas Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.34 2000/12/19 05:10:06 csapuntz Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -782,10 +782,16 @@ wdc_atapi_real_start(chp, xfer, timeout)
chp->wdc->sc_dev.dv_xname, chp->channel, drvp->drive,
sc_xfer->flags), DEBUG_XFERS);
- /* Adjust C_DMA, it may have changed if we are requesting sense */
+ /*
+ * Only set the DMA flag if the transfer is reasonably large.
+ * At least one older drive failed to complete a 4 byte DMA transfer.
+ */
+
+ /* Turn off DMA flag on REQUEST SENSE */
+
if (!(xfer->c_flags & C_POLL) &&
(drvp->drive_flags & (DRIVE_DMA | DRIVE_UDMA)) &&
- (xfer->c_bcount > 0 || (xfer->c_flags & C_SENSE)))
+ (xfer->c_bcount > 100 || (xfer->c_flags & C_SENSE)))
xfer->c_flags |= C_DMA;
else
xfer->c_flags &= ~C_DMA;
@@ -1561,7 +1567,7 @@ wdc_atapi_reset_2(chp, xfer, timeout)
struct scsi_xfer *sc_xfer = xfer->cmd;
if (timeout) {
- printf("%s:%d:%d: reset failed\n",
+ printf("%s:%d:%d: soft reset failed\n",
chp->wdc->sc_dev.dv_xname, chp->channel,
xfer->drive);
sc_xfer->error = XS_SELTIMEOUT;