From: chuck Date: Thu, 8 Feb 1996 04:43:45 +0000 (+0000) Subject: - moved disk_busy() call from xdstrategy() to xdc_startbuf() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0e0bf0d906b2bc090bcd392adb109ae664a86a26;p=openbsd - 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] --- diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c index 7c649161b24..04d21f71d2a 100644 --- a/sys/arch/sparc/dev/xd.c +++ b/sys/arch/sparc/dev/xd.c @@ -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.5 1996/01/13 03:45:01 chuck Exp $ + * id: $Id: xd.c,v 1.6 1996/02/08 04:43:45 chuck Exp $ * started: 27-Feb-95 * references: [1] Xylogics Model 753 User's Manual * part number: 166-753-001, Revision B, May 21, 1988. @@ -1094,9 +1094,6 @@ xdstrategy(bp) return; } - /* Instrumentation. */ - disk_busy(&xd->sc_dk); - /* done! */ splx(s); @@ -1441,6 +1438,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); @@ -1928,9 +1928,9 @@ xdc_remove_iorq(xdcsc) dvma_mapout((vm_offset_t) iorq->dbufbase, (vm_offset_t) bp->b_un.b_addr, bp->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: diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c index 3543a7c2d7e..3352fd1bfe8 100644 --- a/sys/arch/sun3/dev/xd.c +++ b/sys/arch/sun3/dev/xd.c @@ -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:52:44 chuck Exp $ + * id: $Id: xd.c,v 1.4 1996/02/08 04:43:47 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: