From owner-freebsd-current Tue Aug 12 07:51:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA25874 for current-outgoing; Tue, 12 Aug 1997 07:51:13 -0700 (PDT) Received: from pluto.plutotech.com (root@mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA25853; Tue, 12 Aug 1997 07:51:07 -0700 (PDT) Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by pluto.plutotech.com (8.8.5/8.8.5) with ESMTP id IAA15534; Tue, 12 Aug 1997 08:50:58 -0600 (MDT) Message-Id: <199708121450.IAA15534@pluto.plutotech.com> X-Mailer: exmh version 2.0zeta 7/24/97 cc: current@FreeBSD.org, stable@FreeBSD.org Subject: Re: Possible aic7xxx fix. In-reply-to: Your message of "Mon, 11 Aug 1997 22:48:26 MDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 12 Aug 1997 08:51:00 -0600 From: "Justin T. Gibbs" Sender: owner-freebsd-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk There was a small bug in the last patch I sent out. Please try this one instead. Thanks to Tor Egge for pointing out the problem. -- Justin T. Gibbs =========================================== FreeBSD - Turning PCs into workstations =========================================== Index: dev/aic7xxx/aic7xxx.reg =================================================================== RCS file: /usr/cvs/src/sys/dev/aic7xxx/aic7xxx.reg,v retrieving revision 1.4 diff -c -r1.4 aic7xxx.reg *** aic7xxx.reg 1997/06/27 19:38:39 1.4 --- aic7xxx.reg 1997/08/12 14:25:35 *************** *** 1079,1084 **** --- 1079,1099 ---- CUR_SCBID { size 1 } + /* + * Running count of commands placed in + * the QOUTFIFO. This is cleared by the + * kernel driver every FIFODEPTH commands. + */ + CMDOUTCNT { + size 1 + } + /* + * Maximum number of entries allowed in + * the QOUT/INFIFO. + */ + FIFODEPTH { + size 1 + } ARG_1 { size 1 mask SEND_MSG 0x80 Index: dev/aic7xxx/aic7xxx.seq =================================================================== RCS file: /usr/cvs/src/sys/dev/aic7xxx/aic7xxx.seq,v retrieving revision 1.74 diff -c -r1.74 aic7xxx.seq *** aic7xxx.seq 1997/06/27 19:38:42 1.74 --- aic7xxx.seq 1997/08/12 14:25:35 *************** *** 643,648 **** --- 643,657 ---- complete: /* Post the SCB and issue an interrupt */ + .if ( SCB_PAGING ) + /* + * Spin loop until there is space + * in the QOUTFIFO. + */ + mov A, FIFODEPTH; + cmp CMDOUTCNT, A je .; + inc CMDOUTCNT; + .endif mov QOUTFIFO,SCB_TAG; mvi INTSTAT,CMDCMPLT; test SCB_CONTROL, ABORT_SCB jz dma_next_scb; Index: i386/scsi/aic7xxx.c =================================================================== RCS file: /usr/cvs/src/sys/i386/scsi/aic7xxx.c,v retrieving revision 1.120 diff -c -r1.120 aic7xxx.c *** aic7xxx.c 1997/07/20 16:21:34 1.120 --- aic7xxx.c 1997/08/12 14:42:25 *************** *** 784,789 **** --- 784,802 ---- int_cleared = 0; while (qoutcnt = (ahc_inb(ahc, QOUTCNT) & ahc->qcntmask)) { + if ((ahc->flags & AHC_PAGESCBS) != 0) { + ahc->cmdoutcnt += qoutcnt; + if (ahc->cmdoutcnt >= ahc->qfullcount) { + /* + * Since paging only occurs on + * aic78X0 chips, we can use + * Auto Access Pause to clear + * the command count. + */ + ahc_outb(ahc, CMDOUTCNT, 0); + ahc->cmdoutcnt = 0; + } + } for (; qoutcnt > 0; qoutcnt--) { scb_index = ahc_inb(ahc, QOUTFIFO); scb = ahc->scb_data->scbarray[scb_index]; *************** *** 2305,2310 **** --- 2318,2326 ---- * their QCount registers. */ ahc_outb(ahc, QCNTMASK, ahc->qcntmask); + + ahc_outb(ahc, FIFODEPTH, ahc->qfullcount); + ahc_outb(ahc, CMDOUTCNT, 0); /* We don't have any waiting selections */ ahc_outb(ahc, WAITING_SCBH, SCB_LIST_NULL); Index: i386/scsi/aic7xxx.h =================================================================== RCS file: /usr/cvs/src/sys/i386/scsi/aic7xxx.h,v retrieving revision 1.41 diff -c -r1.41 aic7xxx.h *** aic7xxx.h 1997/06/27 19:39:20 1.41 --- aic7xxx.h 1997/08/12 14:25:36 *************** *** 265,270 **** --- 265,271 ---- * waiting for space in the QINFIFO. */ u_int8_t activescbs; + u_int8_t cmdoutcnt; u_int16_t needsdtr_orig; /* Targets we initiate sync neg with */ u_int16_t needwdtr_orig; /* Targets we initiate wide neg with */ u_int16_t needsdtr; /* Current list of negotiated targets */