From owner-freebsd-hackers Fri Jun 9 11:48:02 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id LAA26899 for hackers-outgoing; Fri, 9 Jun 1995 11:48:02 -0700 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id LAA26889 ; Fri, 9 Jun 1995 11:47:56 -0700 Received: (dufault@localhost) by hda.com (8.6.11/8.3) id OAA17606; Fri, 9 Jun 1995 14:47:14 -0400 From: Peter Dufault Message-Id: <199506091847.OAA17606@hda.com> Subject: Re: cvs commit: src/sys/pci aic7870.c To: davidg@freefall.cdrom.com (David Greenman) Date: Fri, 9 Jun 1995 14:47:13 -0400 (EDT) Cc: hackers@freebsd.org In-Reply-To: <199506091806.LAA21171@freefall.cdrom.com> from "David Greenman" at Jun 9, 95 11:06:55 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 2385 Sender: hackers-owner@freebsd.org Precedence: bulk David Greenman writes: (sorry about that last empty message, David) > 1) SCSI_RESID_VALID was not getting set in xs->flags so even though the > aic7xxx driver was doing the right thing, it was getting ignored by the > upper level scsi code. This may affect tape drives, so I consider this > a critical fix. No, the tape code sets the RESID flag itself based on the info field. Prior to adding the RESID_VALID flag for the aha1542 none of the drivers had it, so there is no need for RESID_VALID unless we want residuals to work properly in the host adapter code for host adapters that can detect it. Don't worry that none of the other low level drivers are setting the RESID_VALID flag. It is good that Justin supports it now, since now the user calls can detect the number of bytes actually transferred for this driver as well as the aha1542. RESID_VALID (IMHO) should go away, and if xs_resid gets set assume it was set on purpose. Note it is not the same as b_resid that is still bogusly used as the cylnder for the disk sort. > 2) xs->status was not set to zero during the initialization of a command. > Although I don't think this should be the client's (ie the driver's) > responsibility, it seems that it currently is, so it needs to be cleared. > Without this change, the upper level scsi code will attempt to interpret > the sense information on every command complete (since xs->status is > usually left at 2, "check sense"). This gives a slight performance > increase, as well as stops fooling /sbin/scsi into thinking there was > an error on the command. You are right; it is foolish the way it is working now. I'm the one who elevated xs->status to something used outside of the host adapter drivers, and the only place it is even looked at in the upper level code is here: > /sys/scsi/scsi_ioctl.c: screq->status = xs->status; where it is returned to the user as the target status for a user scsi call. That is why the only symptom was scsi(8) failing. The correct fix is, as you said, to clear it up above. "scsi(8)" may not work for other host adapters (and we may be getting the extra check sense branches). I'd elect to clear it in get_xs() in scsi_base.c. -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267