From 718ac5d2468969b5373554cc901787d42031bedb Mon Sep 17 00:00:00 2001 From: chuck Date: Thu, 8 Feb 1996 04:42:57 +0000 Subject: [PATCH] [import changes from sparc port] - moved disk_busy() call from xdstrategy() to xdc_startbuf() [prevents disk_unbusy panic when disk is loaded (if no free IOPBs, xdstrategy() would queue the buffer for pickup by xdcintr() but xdcintr() would never call disk_busy(). xdc_startbuf() is a better place since all bufs are routed through here] problem detected by girish@dworkin.wustl.edu, diagnosed and corrected by me. - move disk_unbusy() call in xdc_remove_iorq() before the call to XDC_FREE() [don't want to access a data structure that was just put on a free list] --- sys/arch/sun3/dev/xd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c index 22185cf1cad5..49d1b120732f 100644 --- a/sys/arch/sun3/dev/xd.c +++ b/sys/arch/sun3/dev/xd.c @@ -1,4 +1,4 @@ -/* $NetBSD: xd.c,v 1.3 1996/01/13 03:50:05 chuck Exp $ */ +/* $NetBSD: xd.c,v 1.4 1996/02/08 04:42:57 chuck Exp $ */ /* * @@ -36,7 +36,7 @@ * x d . c x y l o g i c s 7 5 3 / 7 0 5 3 v m e / s m d d r i v e r * * author: Chuck Cranor - * id: $Id: xd.c,v 1.3 1996/01/13 03:50:05 chuck Exp $ + * id: $Id: xd.c,v 1.4 1996/02/08 04:42:57 chuck Exp $ * started: 27-Feb-95 * references: [1] Xylogics Model 753 User's Manual * part number: 166-753-001, Revision B, May 21, 1988. @@ -1067,9 +1067,6 @@ xdstrategy(bp) return; } - /* Instrumentation. */ - disk_busy(&xd->sc_dk); - /* done! */ splx(s); @@ -1425,6 +1422,9 @@ xdc_startbuf(xdcsc, xdsc, bp) xdc_rqtopb(iorq, iopb, (bp->b_flags & B_READ) ? XDCMD_RD : XDCMD_WR, 0); + /* Instrumentation. */ + disk_busy(&xdsc->sc_dk); + /* now submit [note that xdc_submit_iorq can never fail on NORM reqs] */ xdc_submit_iorq(xdcsc, rqno, XD_SUB_NORM); @@ -1911,9 +1911,9 @@ xdc_remove_iorq(xdcsc) /* Sun3: map/unmap regardless of B_PHYS */ dvma_mapout(iorq->dbufbase, iorq->buf->b_bcount); - XDC_FREE(xdcsc, rqno); disk_unbusy(&iorq->xd->sc_dk, (bp->b_bcount - bp->b_resid)); + XDC_FREE(xdcsc, rqno); biodone(bp); break; case XD_SUB_WAIT: