From owner-freebsd-scsi Mon Jan 24 7:35:55 2000 Delivered-To: freebsd-scsi@freebsd.org Received: from webweaving.org (calcaphon.demon.co.uk [193.237.19.5]) by hub.freebsd.org (Postfix) with ESMTP id 8840615A62 for ; Mon, 24 Jan 2000 07:35:49 -0800 (PST) (envelope-from n_hibma@webweaving.org) Received: from localhost (localhost [127.0.0.1]) by webweaving.org (8.9.3/8.9.3) with ESMTP id PAA01515; Mon, 24 Jan 2000 15:24:03 GMT (envelope-from n_hibma@webweaving.org) Date: Mon, 24 Jan 2000 15:24:02 +0000 (GMT) From: Nick Hibma X-Sender: n_hibma@localhost Reply-To: Nick Hibma To: Matthew Jacob Cc: FreeBSD SCSI Mailing List Subject: Re: bug in cam_periph.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I found the code while implementing the autosense in software in the umass driver. This is true for the vpo driver as well. You are basically saying that we could implement the sense command there. Except that of course for example from scsi_da.c that generic routine is never called. It relies on autosense I believe. Nick On Mon, 24 Jan 2000, Matthew Jacob wrote: > You're right that the existing code makes no sense. This is actually an area > which needs some serious work, but hasn't been excercised much because we > don't have HBA's that don't do some form of autosense or self-autosense. > > In my opinion, you're patch is logically right, but the whole block is not > quite right- if auto sense failed, the midlayer should run a SENSE command, > else the command should, I guess, be retried if retries are left. > > > > On Mon, 24 Jan 2000, Nick Hibma wrote: > > > > > the following diff code does not make sense to me. first check for a > > retry count larger than zero and return EIO when it is. I guess that > > this piee of code has not been exercised very much, because changing it > > did not make a difference for the SCSI devices I have here. > > > > > > } else if (ccb->ccb_h.retry_count > 0) { > > /* > > * XXX KDM shouldn't there be a better > > * argument to return?? > > */ > > error = EIO; > > } else { > > /* decrement the number of retries */ > > retry = ccb->ccb_h.retry_count > 0; > > if (retry) > > ccb->ccb_h.retry_count--; > > /* > > * If it was aborted with no > > * clue as to the reason, just > > * retry it again. > > */ > > error = ERESTART; > > } > > > > > > > > > > Patch below: > > > > --- cam_periph.c.orig Mon Jan 24 10:34:23 2000 > > +++ cam_periph.c Mon Jan 24 10:34:27 2000 > > @@ -1439,7 +1439,7 @@ > > "CAM_AUTOSENSE_FAILED"); > > /* NOTREACHED */ > > error = EIO; > > - } else if (ccb->ccb_h.retry_count > 0) { > > + } else if (ccb->ccb_h.retry_count == 0) { > > /* > > * XXX KDM shouldn't there be a better > > * argument to return?? > > > > -- > > n_hibma@webweaving.org > > n_hibma@freebsd.org USB project > > http://www.etla.net/~n_hibma/ > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-scsi" in the body of the message > > > > -- n_hibma@webweaving.org n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message