From owner-freebsd-bugs Mon Jan 22 04:35:00 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id EAA07756 for bugs-outgoing; Mon, 22 Jan 1996 04:35:00 -0800 (PST) Received: from hda.com (hda.com [199.232.40.182]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id EAA07746 for ; Mon, 22 Jan 1996 04:34:56 -0800 (PST) Received: (from dufault@localhost) by hda.com (8.6.11/8.6.9) id HAA09921; Mon, 22 Jan 1996 07:33:57 -0500 From: Peter Dufault Message-Id: <199601221233.HAA09921@hda.com> Subject: Re: Bug with NCR810 driver: Corrections, Additions and a Solution, see previous message To: wirth@zerberus.hai.siemens.co.at (Helmut Wirth) Date: Mon, 22 Jan 1996 07:33:56 -0500 (EST) Cc: freebsd-bugs@freebsd.org, wirth@zerberus.hai.siemens.co.at In-Reply-To: <9601221141.AA09490@zerberus.hai.siemens.co.at> from "Helmut Wirth" at Jan 22, 96 12:41:37 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-bugs@freebsd.org Precedence: bulk > 1) The traces from the SCSI driver show (with the log time entries) that the retries > it does are by far to fast for the unit to become ready again. The unit needs about > 1 to 1.5 seconds to do its recalibration but the driver is through with its > retries in under 1 second. Perhaps the retries should be slower for some things > as for example a failed TEST_UNIT_READY. Yes, this is a problem that I have on my "fix" list. The retry code pretty much just slams the disk with retries in the interrupt routine without delays. You can try this "untested yet compiles" fix that should delay 1s between retries. *** scsi_base.c.orig Mon Jan 22 07:26:46 1996 --- scsi_base.c Mon Jan 22 07:24:05 1996 *************** *** 348,353 **** --- 348,367 ---- flags)); } + static void + delayed_retry(void *handle) + { + struct scsi_xfer *xs = (struct scsi_xfer *)handle; + struct scsi_link *sc_link = ((struct scsi_xfer *)xs)->sc_link; + struct buf *bp = xs->bp; + + if ((*(sc_link->adapter->scsi_cmd))(xs) != SUCCESSFULLY_QUEUED) { + xs->flags |= ITSDONE; + free_xs(xs, sc_link, SCSI_NOSLEEP); + biodone(bp); + } + } + /* * This routine is called by the scsi interrupt when the transfer is complete. */ *************** *** 418,428 **** * If it returns SCSIRET_DO_RETRY then we should RETRY */ if ((retval = sc_err1(xs)) == SCSIRET_DO_RETRY) { ! if ((*(sc_link->adapter->scsi_cmd)) (xs) ! == SUCCESSFULLY_QUEUED) { /* don't wake the job, ok? */ ! return; ! } ! xs->flags |= ITSDONE; } free_xs(xs, sc_link, SCSI_NOSLEEP); /* does a start if needed */ --- 432,439 ---- * If it returns SCSIRET_DO_RETRY then we should RETRY */ if ((retval = sc_err1(xs)) == SCSIRET_DO_RETRY) { ! timeout(delayed_retry,(void *)xs,hz); ! return; } free_xs(xs, sc_link, SCSI_NOSLEEP); /* does a start if needed */ I believe you also are getting that the "disk is in the process of coming ready", which should be retried forever. That is another problem that should be changed. I'll look over your other note. -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267