aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-08-05 22:45:40 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-08 10:55:39 -0400
commitb21a41385118f9a6af3cd96ce71090c5ada52eb5 (patch)
tree4eb9124ae72e1a905094c259465718793698e603 /include/scsi
parentf03a567054fea4f9d43c50ec91338266c0bd588d (diff)
[SCSI] add global timeout to the scsi mid-layer
There are certain rogue devices (and the aic7xxx driver) that return BUSY or QUEUE_FULL forever. This code will apply a global timeout (of the total number of retries times the per command timer) to a given command. If it is exceeded, the command is completed regardless of its state. The patch also removes the unused field in the command: timeout and timeout_total. This solves the problem of detecting an endless loop in the mid-layer because of BUSY/QUEUE_FULL bouncing, but will not recover the device. In the aic7xxx case, the driver can be recovered by sending a bus reset, so possibly this should be tied into the error handler? Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_cmnd.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 9957f16dcc5d..bed4b7c9be99 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -51,12 +51,16 @@ struct scsi_cmnd {
51 * printk's to use ->pid, so that we can kill this field. 51 * printk's to use ->pid, so that we can kill this field.
52 */ 52 */
53 unsigned long serial_number; 53 unsigned long serial_number;
54 /*
55 * This is set to jiffies as it was when the command was first
56 * allocated. It is used to time how long the command has
57 * been outstanding
58 */
59 unsigned long jiffies_at_alloc;
54 60
55 int retries; 61 int retries;
56 int allowed; 62 int allowed;
57 int timeout_per_command; 63 int timeout_per_command;
58 int timeout_total;
59 int timeout;
60 64
61 unsigned char cmd_len; 65 unsigned char cmd_len;
62 unsigned char old_cmd_len; 66 unsigned char old_cmd_len;