Set the boundary to NBPG for bus_dmamap_create(). The IOASIC DMA segment

can not cross a page boundary.  This fixes a problem when a dump(8) buffer
just crossed a page boundary and bus_dmamap_load() would coalesce the
the overlap onto the first segment.  The NEXTPTR value would get set to
-1 when starting the DMA transfer and the residual data for unaligned
transfers would be copied to physical address 0x1ffffffc.  On the R3000,
this would result in corrupted data, and on the R4000 would usually result
in a hard system hang.
This commit is contained in:
mhitch 2000-09-28 03:27:29 +00:00
parent 226b343323
commit f9521e4c70

View File

@ -1,4 +1,4 @@
/* $NetBSD: asc_ioasic.c,v 1.9 2000/06/07 10:09:19 nisimura Exp $ */
/* $NetBSD: asc_ioasic.c,v 1.10 2000/09/28 03:27:29 mhitch Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: asc_ioasic.c,v 1.9 2000/06/07 10:09:19 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: asc_ioasic.c,v 1.10 2000/09/28 03:27:29 mhitch Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -143,7 +143,7 @@ asc_ioasic_attach(parent, self, aux)
}
asc->sc_dmat = ((struct ioasic_softc *)parent)->sc_dmat;
if (bus_dmamap_create(asc->sc_dmat, NBPG * 2,
2, NBPG, 0, BUS_DMA_NOWAIT, &asc->sc_dmamap)) {
2, NBPG, NBPG, BUS_DMA_NOWAIT, &asc->sc_dmamap)) {
printf(": failed to create DMA map\n");
return;
}