From c19e09786ae641a353a484bb8ace2e97269c5b2b Mon Sep 17 00:00:00 2001 From: ken Date: Fri, 2 Oct 1998 05:15:51 +0000 Subject: [PATCH] Patches from DES to create three new kernel config options to control timeouts in the SA driver (timeouts for space, rewind and erase). Folks can lengthen the timeouts if their hardware is especially slow, or shorten them if they want to be notified of errors a little sooner. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also, get rid of two OD driver options. The od driver has been made obsolete by the da driver. Reviewed by: ken, gibbs Submitted by: Dag-Erling Coidan Smørgrav --- sys/cam/scsi/scsi_sa.c | 23 ++++++++++++++++------- sys/conf/NOTES | 10 +++++++++- sys/conf/options | 9 +++++---- sys/i386/conf/LINT | 10 +++++++++- sys/i386/conf/NOTES | 10 +++++++++- 5 files changed, 48 insertions(+), 14 deletions(-) diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index b91b594dbb1..5e961da28a4 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: scsi_sa.c,v 1.1 1998/09/15 06:36:34 gibbs Exp $ */ #include @@ -61,6 +61,18 @@ #ifdef KERNEL +#include + +#ifndef SA_SPACE_TIMEOUT +#define SA_SPACE_TIMEOUT 1 * 60 +#endif +#ifndef SA_REWIND_TIMEOUT +#define SA_REWIND_TIMEOUT 2 * 60 +#endif +#ifndef SA_ERASE_TIMEOUT +#define SA_ERASE_TIMEOUT 4 * 60 +#endif + #define SAUNIT(DEV) ((minor(DEV)&0xF0) >> 4) /* 4 bit unit. */ #define SASETUNIT(DEV, U) makedev(major(DEV), ((U) << 4)) @@ -1835,16 +1847,13 @@ sarewind(struct cam_periph *periph) ccb = cam_periph_getccb(periph, /*priority*/1); - /* - * Put in a 2 hour timeout to deal with especially slow tape drives. - */ scsi_rewind(&ccb->csio, /*retries*/1, /*cbcfp*/sadone, MSG_SIMPLE_Q_TAG, /*immediate*/FALSE, SSD_FULL_SIZE, - (120 * 60 * 1000)); /* 2 hours */ + (SA_REWIND_TIMEOUT) * 60 * 1000); error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0, /*sense_flags*/0, &softc->device_stats); @@ -1878,7 +1887,7 @@ saspace(struct cam_periph *periph, int count, scsi_space_code code) MSG_SIMPLE_Q_TAG, code, count, SSD_FULL_SIZE, - 60 * 60 *1000); + (SA_SPACE_TIMEOUT) * 60 * 1000); error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0, /*sense_flags*/0, &softc->device_stats); @@ -2073,7 +2082,7 @@ saerase(struct cam_periph *periph, int longerase) /*immediate*/ FALSE, /*long_erase*/ longerase, /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 4 * 60 * 60 * 1000); /* 4 hours */ + /*timeout*/ (SA_ERASE_TIMEOUT) * 60 * 1000); error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0, /*sense_flags*/0, &softc->device_stats); diff --git a/sys/conf/NOTES b/sys/conf/NOTES index a944fa9012d..9af20db0f19 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.478 1998/09/29 17:33:45 abial Exp $ +# $Id: LINT,v 1.479 1998/10/01 11:48:38 yokota Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -703,6 +703,14 @@ options SCSI_DELAY=8000 # Be pessimistic about Joe SCSI device options "CHANGER_MIN_BUSY_SECONDS=2" options "CHANGER_MAX_BUSY_SECONDS=10" +# Options for the CAM sequential access driver: +# SA_SPACE_TIMEOUT: Timeout for space operations, in minutes +# SA_REWIND_TIMEOUT: Timeout for rewind operations, in minutes +# SA_ERASE_TIMEOUT: Timeout for erase operations, in minutes +options "SA_SPACE_TIMEOUT=(60)" +options "SA_REWIND_TIMEOUT=(2*60)" +options "SA_ERASE_TIMEOUT=(4*60)" + ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS diff --git a/sys/conf/options b/sys/conf/options index 6360db0c584..efa9e4f62ee 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1,4 +1,4 @@ -# $Id: options,v 1.100 1998/09/25 17:34:47 peter Exp $ +# $Id: options,v 1.101 1998/09/29 17:32:18 abial Exp $ # # On the handling of kernel options # @@ -159,9 +159,10 @@ SCSI_NO_OP_STRINGS opt_scsi.h CHANGER_MIN_BUSY_SECONDS opt_cd.h CHANGER_MAX_BUSY_SECONDS opt_cd.h -# Options used only in scsi/od.c. -OD_AUTO_TURNOFF opt_od.h -OD_BOGUS_NOT_READY opt_od.h +# Options used only in cam/scsi/sa.c. +SA_SPACE_TIMEOUT opt_sa.h +SA_REWIND_TIMEOUT opt_sa.h +SA_ERASE_TIMEOUT opt_sa.h # Options used only in pci/ncr.c SCSI_NCR_DEBUG opt_ncr.h diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index a944fa9012d..9af20db0f19 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.478 1998/09/29 17:33:45 abial Exp $ +# $Id: LINT,v 1.479 1998/10/01 11:48:38 yokota Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -703,6 +703,14 @@ options SCSI_DELAY=8000 # Be pessimistic about Joe SCSI device options "CHANGER_MIN_BUSY_SECONDS=2" options "CHANGER_MAX_BUSY_SECONDS=10" +# Options for the CAM sequential access driver: +# SA_SPACE_TIMEOUT: Timeout for space operations, in minutes +# SA_REWIND_TIMEOUT: Timeout for rewind operations, in minutes +# SA_ERASE_TIMEOUT: Timeout for erase operations, in minutes +options "SA_SPACE_TIMEOUT=(60)" +options "SA_REWIND_TIMEOUT=(2*60)" +options "SA_ERASE_TIMEOUT=(4*60)" + ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index a944fa9012d..9af20db0f19 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.478 1998/09/29 17:33:45 abial Exp $ +# $Id: LINT,v 1.479 1998/10/01 11:48:38 yokota Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -703,6 +703,14 @@ options SCSI_DELAY=8000 # Be pessimistic about Joe SCSI device options "CHANGER_MIN_BUSY_SECONDS=2" options "CHANGER_MAX_BUSY_SECONDS=10" +# Options for the CAM sequential access driver: +# SA_SPACE_TIMEOUT: Timeout for space operations, in minutes +# SA_REWIND_TIMEOUT: Timeout for rewind operations, in minutes +# SA_ERASE_TIMEOUT: Timeout for erase operations, in minutes +options "SA_SPACE_TIMEOUT=(60)" +options "SA_REWIND_TIMEOUT=(2*60)" +options "SA_ERASE_TIMEOUT=(4*60)" + ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS -- 2.45.2