Subject: Re: kern/12762: Latest AIC 7xxx driver causes SCSI bus lockups
To: Matthias Scheler <tron@colwyn.zhadum.de>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-bugs
Date: 04/26/2001 21:43:27
--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii

On Thu, Apr 26, 2001 at 08:40:56PM +0200, Matthias Scheler wrote:
> >Description:
> After upgrading to the latest AIC 7xxx driver my system died two times due
> to SCSI bus lockups during medium I/O load. Half a minute after the bus
> locked up these message appear on the console:
> 
> sd1(ahc0:0:1:0): invalid return code from adapter: 3
> sd1(ahc0:0:1:0): invalid return code from adapter: 3
> sd1(ahc0:0:1:0): invalid return code from adapter: 3
> sd1(ahc0:0:1:0): invalid return code from adapter: 3
> sd1(ahc0:0:1:0): invalid return code from adapter: 3
> [...]
> sd1(ahc0:0:1:0): invalid return code from adapter: 3

This is "XS_DRIVER_STUFFUP"; something bad happened.

> 
> >Fix:
> Backout revision 1.71 of "syssrc/sys/dev/ic/aic7xxx.c".

This will disable tagged queuing

Can you try the attached patch ?
the pre-thorpej_scispi driver allowed at most 16 tagged CMD per device;
thorpej_scispi bumped it to AHC_SCB_MAX (255). Maybe this pushes things too
hard .... this patch restores the initial behavior

--
Manuel Bouyer <bouyer@antioche.eu.org>
--

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

--- aic7xxx.c.old	Thu Apr 26 21:21:10 2001
+++ aic7xxx.c	Thu Apr 26 21:25:24 2001
@@ -1371,8 +1371,16 @@
 {
 	ahc->sc_adapter.adapt_dev = &ahc->sc_dev;
 	ahc->sc_adapter.adapt_nchannels = (ahc->features & AHC_TWIN) ? 2 : 1;
-	ahc->sc_adapter.adapt_openings = AHC_SCB_MAX;
-	ahc->sc_adapter.adapt_max_periph = AHC_SCB_MAX;
+	if (ahc->flags & AHC_PAGESCBS) {
+		ahc->sc_adapter.adapt_openings = AHC_SCB_MAX;
+		ahc->sc_adapter.adapt_max_periph = 16;
+	} else {
+		ahc->sc_adapter.adapt_openings =  ahc->scb_data->maxhscbs;
+		if (ahc->scb_data->maxhscbs >= 16)
+			ahc->sc_adapter.adapt_max_periph = 16;
+		else
+			ahc->sc_adapter.adapt_max_periph = 4;
+	}
 	ahc->sc_adapter.adapt_ioctl = ahc_ioctl;
 	ahc->sc_adapter.adapt_minphys = ahcminphys;
 	ahc->sc_adapter.adapt_request = ahc_action;

--IJpNTDwzlM2Ie8A6--