diff options
author | Hannes Reinecke <hare@suse.de> | 2013-10-23 04:51:21 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 07:17:59 -0400 |
commit | b45620229dd67ff1daffa8adce57f37b37860f78 (patch) | |
tree | 22f8577437188e6699fa9d1f05841ea1f545a68f /drivers/scsi/hosts.c | |
parent | 6b1e5a45d4eaa75e28f2d170ea43ab8fc6dd34d8 (diff) |
[SCSI] Add 'eh_deadline' to limit SCSI EH runtime
This patchs adds an 'eh_deadline' sysfs attribute to the scsi
host which limits the overall runtime of the SCSI EH.
The 'eh_deadline' value is stored in the now obsolete field
'resetting'.
When a command is failed the start time of the EH is stored
in 'last_reset'. If the overall runtime of the SCSI EH is longer
than last_reset + eh_deadline, the EH is short-circuited and
falls through to issue a host reset only.
[jejb: add comments in Scsi_Host about new fields]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index df0c3c71ea43..f334859024c0 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -316,6 +316,12 @@ static void scsi_host_dev_release(struct device *dev) | |||
316 | kfree(shost); | 316 | kfree(shost); |
317 | } | 317 | } |
318 | 318 | ||
319 | static unsigned int shost_eh_deadline; | ||
320 | |||
321 | module_param_named(eh_deadline, shost_eh_deadline, uint, S_IRUGO|S_IWUSR); | ||
322 | MODULE_PARM_DESC(eh_deadline, | ||
323 | "SCSI EH timeout in seconds (should be between 1 and 2^32-1)"); | ||
324 | |||
319 | static struct device_type scsi_host_type = { | 325 | static struct device_type scsi_host_type = { |
320 | .name = "scsi_host", | 326 | .name = "scsi_host", |
321 | .release = scsi_host_dev_release, | 327 | .release = scsi_host_dev_release, |
@@ -388,6 +394,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
388 | shost->unchecked_isa_dma = sht->unchecked_isa_dma; | 394 | shost->unchecked_isa_dma = sht->unchecked_isa_dma; |
389 | shost->use_clustering = sht->use_clustering; | 395 | shost->use_clustering = sht->use_clustering; |
390 | shost->ordered_tag = sht->ordered_tag; | 396 | shost->ordered_tag = sht->ordered_tag; |
397 | shost->eh_deadline = shost_eh_deadline * HZ; | ||
391 | 398 | ||
392 | if (sht->supported_mode == MODE_UNKNOWN) | 399 | if (sht->supported_mode == MODE_UNKNOWN) |
393 | /* means we didn't set it ... default to INITIATOR */ | 400 | /* means we didn't set it ... default to INITIATOR */ |