diff options
| author | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
| commit | 5c34202b8bf942da411b6599668a76b07449bbfd (patch) | |
| tree | 5719c361321eaddc8e4f1b0c8a7994f0e9a6fdd3 /drivers/scsi/scsi_error.c | |
| parent | 0d4804b31f91cfbcff6d62af0bc09a893a1c8ae0 (diff) | |
| parent | 1f8a6b658a943b4f04a1fc7b3a420360202c86cd (diff) | |
Merge /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/scsi/scsi_error.c')
| -rw-r--r-- | drivers/scsi/scsi_error.c | 20 | 
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 918bb601954..e8350c562d2 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -38,7 +38,6 @@  #include "scsi_logging.h"  #define SENSE_TIMEOUT		(10*HZ) -#define START_UNIT_TIMEOUT	(30*HZ)  /*   * These should *probably* be handled by the host itself. @@ -184,10 +183,19 @@ int scsi_delete_timer(struct scsi_cmnd *scmd)   **/  void scsi_times_out(struct scsi_cmnd *scmd)  { +	enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); +  	scsi_log_completion(scmd, TIMEOUT_ERROR);  	if (scmd->device->host->transportt->eh_timed_out) -		switch (scmd->device->host->transportt->eh_timed_out(scmd)) { +		eh_timed_out = scmd->device->host->transportt->eh_timed_out; +	else if (scmd->device->host->hostt->eh_timed_out) +		eh_timed_out = scmd->device->host->hostt->eh_timed_out; +	else +		eh_timed_out = NULL; + +	if (eh_timed_out) +		switch (eh_timed_out(scmd)) {  		case EH_HANDLED:  			__scsi_done(scmd);  			return; @@ -923,10 +931,12 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)  	static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};  	if (scmd->device->allow_restart) { -		int rtn; +		int i, rtn = NEEDS_RETRY; + +		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++) +			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, +						scmd->device->timeout, 0); -		rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, -					START_UNIT_TIMEOUT, 0);  		if (rtn == SUCCESS)  			return 0;  	}  | 
