When a read DMA transfer is interrupted by a disconnect on the IOASIC SCSI

and the buffer is not 8-byte aligned, it leaves a partial transfer in the
SDRx registers.  This could cause data corruption in dump(8) because the
read-ahead buffers are allocated on a non-aligned address.  When the read
DMA transfer is interrupted and the current DMA position is not aligned,
call the dma_end() routine to flush the SDRx register contents to the
buffer.
This commit is contained in:
mhitch 2000-11-02 21:00:04 +00:00
parent a5c364efbb
commit f5f7066fc8
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: asc.c,v 1.60 2000/03/30 12:45:43 augustss Exp $ */
/* $NetBSD: asc.c,v 1.61 2000/11/02 21:00:04 mhitch Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -1040,6 +1040,14 @@ again:
state->script =
&asc_scripts[SCRIPT_RESUME_DMA_IN];
state->flags |= DMA_RESUME;
/*
* If the transfer doesn't end on a 8-byte
* boundary, and it's an IOASIC DMA read,
* the SDRx registers need to be written to
* the buffer.
*/
if (((int)state->buf + state->dmalen - len) & 7)
(*asc->dma_end)(asc, state, ASCDMA_READ);
} else if (state->flags & DMA_OUT) {
state->script =
&asc_scripts[SCRIPT_RESUME_DMA_OUT];