From 4626bcf70ba6e71d057c1f6ef1545b11c95ad327 Mon Sep 17 00:00:00 2001 From: gibbs Date: Mon, 24 Mar 1997 05:05:18 +0000 Subject: [PATCH] Fix a nasty bug that meant a QUEUE_FULL status would result in a lost SCB. This is probably a main reason for the recent reports of timeouts. --- sys/i386/scsi/aic7xxx.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c index 3f78390b28ed..f6ae3c638934 100644 --- a/sys/i386/scsi/aic7xxx.c +++ b/sys/i386/scsi/aic7xxx.c @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.c,v 1.106 1997/03/16 07:12:07 gibbs Exp $ + * $Id: aic7xxx.c,v 1.107 1997/03/23 06:33:36 bde Exp $ */ /* * TODO: @@ -813,8 +813,7 @@ ahc_intr(arg) scb->xs->error); ahc_run_done_queue(ahc); } - if (scb->hscb->status != SCSI_QUEUE_FULL) - ahc_done(ahc, scb); + ahc_done(ahc, scb); } ahc_outb(ahc, CLRINT, CLRCMDINT); int_cleared++; @@ -1335,13 +1334,8 @@ ahc_handle_seqint(ahc, intstat) /* * XXX requeue this unconditionally. */ - STAILQ_INSERT_TAIL(&ahc->waiting_scbs, scb, - links); - scb->flags |= SCB_WAITINGQ; - /* Give the command a new lease on life */ - untimeout(ahc_timeout, (caddr_t)scb); - timeout(ahc_timeout, (caddr_t)scb, - (scb->xs->timeout * hz) / 1000); + scb->xs->retries++; + scb->xs->error = XS_BUSY; break; } /* Else treat as if it is a BUSY condition */ @@ -2567,7 +2561,12 @@ ahc_run_waiting_queue(ahc) { struct scb *scb; - pause_sequencer(ahc); + /* + * On aic78X0 chips, we rely on Auto Access Pause (AAP) + * instead of doing an explicit pause/unpause. + */ + if ((ahc->type & AHC_AIC78X0) == 0) + pause_sequencer(ahc); while ((scb = ahc->waiting_scbs.stqh_first) != NULL) { @@ -2589,7 +2588,8 @@ ahc_run_waiting_queue(ahc) */ ahc->curqincnt++; } - unpause_sequencer(ahc, /*Unpause always*/FALSE); + if ((ahc->type & AHC_AIC78X0) == 0) + unpause_sequencer(ahc, /*Unpause always*/FALSE); } /*