From owner-freebsd-scsi Thu Aug 30 11:34:14 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from postfix1-2.free.fr (postfix1-2.free.fr [213.228.0.130]) by hub.freebsd.org (Postfix) with ESMTP id 3840337B405; Thu, 30 Aug 2001 11:34:09 -0700 (PDT) (envelope-from groudier@free.fr) Received: from nas-cbv-7-23-160.dial.proxad.net (nas-cbv-7-23-160.dial.proxad.net [213.228.23.160]) by postfix1-2.free.fr (Postfix) with ESMTP id 761A5AB1B3; Thu, 30 Aug 2001 20:33:17 +0200 (CEST) Date: Thu, 30 Aug 2001 20:30:27 +0200 (CEST) From: =?ISO-8859-1?Q?G=E9rard_Roudier?= X-X-Sender: To: "Kenneth D. Merry" Cc: Thomas Quinot , , Subject: Re: Failure to attach SCSI CD burner In-Reply-To: <20010830102820.A47131@panzer.kdm.org> Message-ID: <20010830201620.M1625-100000@gerard> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 30 Aug 2001, Kenneth D. Merry wrote: > On Thu, Aug 30, 2001 at 09:06:01 +0200, Thomas Quinot wrote: > > Le 2001-08-29, Thomas Quinot =E9crivait : > > > > > > Apply the attached patch in place of the one I gave you before and = send the > > > > output when you boot. This will print out the SCSI status byte. > > > Thanks, applied, I'll let you know as soon as I get a chance to reboo= t. > > > > OK, here we are: > > > > (cd0:sym0:0:2:0): autosense is NOT valid > > (cd0:sym0:0:2:0): flags =3D 0x40 status =3D 0x4c > > (cd0:sym0:0:2:0): SCSI status =3D 0x8 > > (cd0:sym0:0:2:0): got CAM status 0x4c > > (cd0:sym0:0:2:0): fatal error, failed to attach to device > > (cd0:sym0:0:2:0): lost device > > (cd0:sym0:0:2:0): removing device entry > > > > Isn't that 'SCSI_STATUS_BUSY' ? > > Yes it is. Here's a patch that should fix your problem. The only SCSI > status I've allowed through (besides check condition) is busy. The rest > are either not likely or are grounds for failing the attach. > > Let me know if this fixes your problem. You patch seems incomplete to me. BUSY is a transient condition and a CD/ROM or a CD/R device is slow as a 25 years old dog when it happens to deal with seeking. A 1 second delay for the BUSY condition to go away does not seem to me a good compromise here. Something like 3 seconds (and possibly 3 retries given that the delay for a retry on BUSY status is hardcoded, but this doesn't matter a lot) seems more appropriate, imo. In order to minimize changes in the code, I suggest to also just make scsi_cd.c allow 3 retries for the READ CAPACITY command, for example. G=E9rard. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message