This patch adds a r/w timeout field to the scsi_device struct to allow LLDs to modify the r/w timeout used by the scsi disk driver. LLDs may setup this field in their slave_configure routines if they require a different timeout to be used for certain devices, such as RAID arrays. --- linux-2.6.5-rc3-bjking1/drivers/scsi/sd.c | 11 ++++++++--- linux-2.6.5-rc3-bjking1/include/scsi/scsi_device.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff -puN drivers/scsi/sd.c~sd_timeout_mod drivers/scsi/sd.c --- linux-2.6.5-rc3/drivers/scsi/sd.c~sd_timeout_mod 2004-03-31 19:55:51.000000000 -0600 +++ linux-2.6.5-rc3-bjking1/drivers/scsi/sd.c 2004-03-31 21:41:31.000000000 -0600 @@ -203,9 +203,7 @@ static int sd_init_command(struct scsi_c sector_t block; struct scsi_device *sdp = SCpnt->device; - timeout = SD_TIMEOUT; - if (SCpnt->device->type != TYPE_DISK) - timeout = SD_MOD_TIMEOUT; + timeout = sdp->rw_timeout; /* * these are already setup, just copy cdb basically @@ -1370,6 +1368,13 @@ static int sd_probe(struct device *dev) sdkp->index = index; sdkp->openers = 0; + if (!sdp->rw_timeout) { + if (sdp->type == TYPE_DISK) + sdp->rw_timeout = SD_TIMEOUT; + else + sdp->rw_timeout = SD_MOD_TIMEOUT; + } + devno = make_sd_dev(index, 0); gd->major = MAJOR(devno); gd->first_minor = MINOR(devno); diff -puN include/scsi/scsi_device.h~sd_timeout_mod include/scsi/scsi_device.h --- linux-2.6.5-rc3/include/scsi/scsi_device.h~sd_timeout_mod 2004-03-31 20:08:26.000000000 -0600 +++ linux-2.6.5-rc3-bjking1/include/scsi/scsi_device.h 2004-03-31 20:10:20.000000000 -0600 @@ -104,6 +104,8 @@ struct scsi_device { unsigned int max_device_blocked; /* what device_blocked counts down from */ #define SCSI_DEFAULT_DEVICE_BLOCKED 3 + int rw_timeout; + struct device sdev_gendev; struct class_device sdev_classdev; _