Subject: Re: vs3100/3x SCSI broken in 2.0_BETA?
To: Paul Kranenburg <pk@cs.few.eur.nl>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-vax
Date: 04/26/2004 22:54:38
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Apr 26, 2004 at 05:44:56PM +0200, Paul Kranenburg wrote:
> see scsipi_base.c, rev 1.102.
> 
> I have pending query with Manuel about this issue:
> 
> 
> the initial test unit ready
> when attaching a drive returns an EIO error resulting in a "drive offline"
> message. This is because the drive issues a "unit attention" after
> the initial scsi bus reset of the adapter. Previously, this condition
> would just generate an ERESTART.  But in the probe phase, XS_CTL_DISCOVERY
> is used which forces the # of retries to 0, causing the unit attention
> to return EIO and hence, the test unit ready to fail.

Hum, it's strange that it's the test unit ready which is affected by this.
the first command after the bus reset is the inquiry.
Maybe inquiry is special regarding sense conditions.

Can you try the attached patch ? For the problem solved in 1.102, there's no
need to check for retry at this place (the problem was really with the bus
reset, not the bus reset condition reported by the device).

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

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

Index: scsipi_base.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_base.c,v
retrieving revision 1.104
diff -u -r1.104 scsipi_base.c
--- scsipi_base.c	16 Mar 2004 19:10:43 -0000	1.104
+++ scsipi_base.c	26 Apr 2004 20:48:28 -0000
@@ -938,12 +938,7 @@
 			if (sense->add_sense_code == 0x29 &&
 			    sense->add_sense_code_qual == 0x00) {
 				/* device or bus reset */
-				if (xs->xs_retries != 0) {
-					xs->xs_retries--;
-					error = ERESTART;
-				} else
-					error = EIO;
-				return (error);
+				return (ERESTART);
 			}
 			if ((periph->periph_flags & PERIPH_REMOVABLE) != 0)
 				periph->periph_flags &= ~PERIPH_MEDIA_LOADED;

--6TrnltStXW4iwmi0--