Add fix for VS4000 SCSI hangs on disk writes. Add a VAX_BUS_DMA_SPILLPAGE

and use it in the asc_vsbus driver.
This commit is contained in:
matt 2000-04-10 03:49:56 +00:00
parent 1c084aee4f
commit 9434b7b19e
4 changed files with 22 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus.h,v 1.11 2000/03/15 16:44:50 drochner Exp $ */
/* $NetBSD: bus.h,v 1.12 2000/04/10 03:49:56 matt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -867,6 +867,7 @@ vax_mem_copy_region_4(t, h1, o1, h2, o2, c)
#define BUS_DMA_BUS3 0x40
#define BUS_DMA_BUS4 0x80
#define VAX_BUS_DMA_SPILLPAGE BUS_DMA_BUS1 /* VS4000 kludge */
/*
* Private flags stored in the DMA map.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: sgmap.h,v 1.1 1999/06/06 18:58:50 ragge Exp $ */
/* $NetBSD: sgmap.h,v 1.2 2000/04/10 03:49:56 matt Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -83,4 +83,4 @@ int vax_sgmap_load_raw __P((bus_dma_tag_t, bus_dmamap_t,
void vax_sgmap_unload __P(( bus_dma_tag_t, bus_dmamap_t,
struct vax_sgmap *));
#endif /* _ALPHA_COMMON_SGMAPVAR_H */
#endif /* _VAX_COMMON_SGMAPVAR_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sgmap.c,v 1.4 2000/03/07 00:04:13 matt Exp $ */
/* $NetBSD: sgmap.c,v 1.5 2000/04/10 03:49:57 matt Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -128,8 +128,14 @@ vax_sgmap_alloc(map, origlen, sgmap, flags)
panic("vax_sgmap_alloc: already have sgva space");
#endif
map->_dm_sgvalen = vax_round_page(len);
/* If we need a spill page (for the VS4000 SCSI), make sure we
* allocate enough space for an extra page.
*/
if (flags & VAX_BUS_DMA_SPILLPAGE) {
len += VAX_NBPG;
}
map->_dm_sgvalen = vax_round_page(len);
#if 0
printf("len %x -> %x, _dm_sgvalen %x _dm_boundary %x boundary %x -> ",
origlen, len, map->_dm_sgvalen, map->_dm_boundary, boundary);
@ -245,6 +251,13 @@ vax_sgmap_load(t, map, buf, buflen, p, flags, sgmap)
*/
*pte = (pa >> VAX_PGSHIFT) | PG_V;
}
/* The VS4000 SCSI prefetcher doesn't like to end on a page boundary
* so add an extra page to quiet it down.
*/
if (flags & VAX_BUS_DMA_SPILLPAGE) {
*pte = pte[-1];
map->_dm_ptecnt++;
}
map->dm_mapsize = buflen;
map->dm_nsegs = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: asc_vsbus.c,v 1.6 2000/03/09 02:02:12 matt Exp $ */
/* $NetBSD: asc_vsbus.c,v 1.7 2000/04/10 03:49:57 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.6 2000/03/09 02:02:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.7 2000/04/10 03:49:57 matt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -387,7 +387,7 @@ asc_vsbus_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
if (bus_dmamap_load(asc->sc_dmat, asc->sc_dmamap,
*asc->sc_dmaaddr, asc->sc_dmasize,
NULL /* kernel address */,
BUS_DMA_NOWAIT))
BUS_DMA_NOWAIT|VAX_BUS_DMA_SPILLPAGE))
panic("%s: cannot load dma map", sc->sc_dev.dv_xname);
bus_dmamap_sync(asc->sc_dmat, asc->sc_dmamap,
0, asc->sc_dmasize,