Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 1996 07:33:56 -0500 (EST)
From:      Peter Dufault <dufault@hda.com>
To:        wirth@zerberus.hai.siemens.co.at (Helmut Wirth)
Cc:        freebsd-bugs@freebsd.org, wirth@zerberus.hai.siemens.co.at
Subject:   Re: Bug with NCR810 driver: Corrections, Additions and a Solution, see previous message
Message-ID:  <199601221233.HAA09921@hda.com>
In-Reply-To: <9601221141.AA09490@zerberus.hai.siemens.co.at> from "Helmut Wirth" at Jan 22, 96 12:41:37 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601221233.HAA09921>