diff options
author | Hannes Reinecke <hare@suse.de> | 2013-11-11 07:44:54 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-19 10:39:02 -0500 |
commit | e494f6a728394ab0df194342549ee20e6f0752df (patch) | |
tree | 2cbae9eea944540b2777e40f1787a90b78123334 /drivers/scsi/scsi_priv.h | |
parent | 2451079bc2ae1334058be8babd44be03ecfa7041 (diff) |
[SCSI] improved eh timeout handler
When a command runs into a timeout we need to send an 'ABORT TASK'
TMF. This is typically done by the 'eh_abort_handler' LLDD callback.
Conceptually, however, this function is a normal SCSI command, so
there is no need to enter the error handler.
This patch implements a new scsi_abort_command() function which
invokes an asynchronous function scsi_eh_abort_handler() to
abort the commands via the usual 'eh_abort_handler'.
If abort succeeds the command is either retried or terminated,
depending on the number of allowed retries. However, 'eh_eflags'
records the abort, so if the retry would fail again the
command is pushed onto the error handler without trying to
abort it (again); it'll be cleared up from SCSI EH.
[hare: smatch detected stray switch fixed]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_priv.h')
-rw-r--r-- | drivers/scsi/scsi_priv.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 8f9a0cadc296..f079a598bed4 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
@@ -19,6 +19,7 @@ struct scsi_nl_hdr; | |||
19 | * Scsi Error Handler Flags | 19 | * Scsi Error Handler Flags |
20 | */ | 20 | */ |
21 | #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ | 21 | #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ |
22 | #define SCSI_EH_ABORT_SCHEDULED 0x0002 /* Abort has been scheduled */ | ||
22 | 23 | ||
23 | #define SCSI_SENSE_VALID(scmd) \ | 24 | #define SCSI_SENSE_VALID(scmd) \ |
24 | (((scmd)->sense_buffer[0] & 0x70) == 0x70) | 25 | (((scmd)->sense_buffer[0] & 0x70) == 0x70) |
@@ -66,6 +67,7 @@ extern int __init scsi_init_devinfo(void); | |||
66 | extern void scsi_exit_devinfo(void); | 67 | extern void scsi_exit_devinfo(void); |
67 | 68 | ||
68 | /* scsi_error.c */ | 69 | /* scsi_error.c */ |
70 | extern void scmd_eh_abort_handler(struct work_struct *work); | ||
69 | extern enum blk_eh_timer_return scsi_times_out(struct request *req); | 71 | extern enum blk_eh_timer_return scsi_times_out(struct request *req); |
70 | extern int scsi_error_handler(void *host); | 72 | extern int scsi_error_handler(void *host); |
71 | extern int scsi_decide_disposition(struct scsi_cmnd *cmd); | 73 | extern int scsi_decide_disposition(struct scsi_cmnd *cmd); |