From owner-freebsd-current Mon Aug 11 21:49:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA28498 for current-outgoing; Mon, 11 Aug 1997 21:49:03 -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 VAA28470; Mon, 11 Aug 1997 21:48:53 -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 WAA04805; Mon, 11 Aug 1997 22:48:52 -0600 (MDT) Message-Id: <199708120448.WAA04805@pluto.plutotech.com> To: current@FreeBSD.org, stable@FreeBSD.org Subject: Possible aic7xxx fix. Date: Mon, 11 Aug 1997 22:48:26 -0600 From: "Justin T. Gibbs" Sender: owner-freebsd-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk For those of you who have been experiencing the "Timedout while idle" and other aic7xxx breakage, please try the following patch and let me know if it helps you out. Thanks __ 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 04:39:03 *************** *** 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 04:32:54 *************** *** 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 04:41:58 *************** *** 784,789 **** --- 784,798 ---- 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) { + pause_sequencer(ahc); + ahc_outb(ahc, CMDOUTCNT, 0); + unpause_sequencer(ahc, + /*unpause_always*/FALSE); + } + } for (; qoutcnt > 0; qoutcnt--) { scb_index = ahc_inb(ahc, QOUTFIFO); scb = ahc->scb_data->scbarray[scb_index]; *************** *** 2305,2310 **** --- 2314,2322 ---- * 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 04:36:46 *************** *** 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 */