public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] Allow LLDs to modify disk r/w timeout
Date: Wed, 31 Mar 2004 22:25:02 -0600	[thread overview]
Message-ID: <406B999E.2020803@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

Attached is a patch that adds a rw_timeout field to the scsi_device 
struct which LLDs can setup in their slave_configure routines to 
override the read/write timeout used by sd. Various disk device types 
(i.e. RAID array devices) need longer timeout values than regular scsi 
disks, and this patch allows for this. This would get remove one of the 
reasons the ipr driver modifies the scsi timer today.

Brian King
eServer Storage I/O
IBM Linux Technology Center

[-- Attachment #2: sd_timeout_mod.patch --]
[-- Type: text/plain, Size: 1881 bytes --]


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;
 

_

                 reply	other threads:[~2004-04-01  4:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=406B999E.2020803@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox