diff options
author | James Bottomley <James.Bottomley@suse.de> | 2010-05-18 10:33:43 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-18 10:37:41 -0400 |
commit | 95bb335c0ebe96afe926387a1ef3a096bd884a82 (patch) | |
tree | 56115332b4f2f7ef300c36248a6a7d20db2e639d /drivers/scsi/scsi_error.c | |
parent | 1b4d0d8ea7b3cbd107f345ab766416f9b38ce66a (diff) | |
parent | 9cccde93fed1ca988eb2fb17ab9194bf7b5ed1b0 (diff) |
[SCSI] Merge scsi-misc-2.6 into scsi-rc-fixes-2.6
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 7ad53fa42766..a5d630f5f519 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include "scsi_logging.h" | 39 | #include "scsi_logging.h" |
40 | #include "scsi_transport_api.h" | 40 | #include "scsi_transport_api.h" |
41 | 41 | ||
42 | #include <trace/events/scsi.h> | ||
43 | |||
42 | #define SENSE_TIMEOUT (10*HZ) | 44 | #define SENSE_TIMEOUT (10*HZ) |
43 | 45 | ||
44 | /* | 46 | /* |
@@ -52,6 +54,7 @@ | |||
52 | void scsi_eh_wakeup(struct Scsi_Host *shost) | 54 | void scsi_eh_wakeup(struct Scsi_Host *shost) |
53 | { | 55 | { |
54 | if (shost->host_busy == shost->host_failed) { | 56 | if (shost->host_busy == shost->host_failed) { |
57 | trace_scsi_eh_wakeup(shost); | ||
55 | wake_up_process(shost->ehandler); | 58 | wake_up_process(shost->ehandler); |
56 | SCSI_LOG_ERROR_RECOVERY(5, | 59 | SCSI_LOG_ERROR_RECOVERY(5, |
57 | printk("Waking error handler thread\n")); | 60 | printk("Waking error handler thread\n")); |
@@ -127,6 +130,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req) | |||
127 | struct scsi_cmnd *scmd = req->special; | 130 | struct scsi_cmnd *scmd = req->special; |
128 | enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED; | 131 | enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED; |
129 | 132 | ||
133 | trace_scsi_dispatch_cmd_timeout(scmd); | ||
130 | scsi_log_completion(scmd, TIMEOUT_ERROR); | 134 | scsi_log_completion(scmd, TIMEOUT_ERROR); |
131 | 135 | ||
132 | if (scmd->device->host->transportt->eh_timed_out) | 136 | if (scmd->device->host->transportt->eh_timed_out) |
@@ -970,9 +974,10 @@ static int scsi_eh_abort_cmds(struct list_head *work_q, | |||
970 | "0x%p\n", current->comm, | 974 | "0x%p\n", current->comm, |
971 | scmd)); | 975 | scmd)); |
972 | rtn = scsi_try_to_abort_cmd(scmd); | 976 | rtn = scsi_try_to_abort_cmd(scmd); |
973 | if (rtn == SUCCESS) { | 977 | if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { |
974 | scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD; | 978 | scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD; |
975 | if (!scsi_device_online(scmd->device) || | 979 | if (!scsi_device_online(scmd->device) || |
980 | rtn == FAST_IO_FAIL || | ||
976 | !scsi_eh_tur(scmd)) { | 981 | !scsi_eh_tur(scmd)) { |
977 | scsi_eh_finish_cmd(scmd, done_q); | 982 | scsi_eh_finish_cmd(scmd, done_q); |
978 | } | 983 | } |
@@ -1099,8 +1104,9 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost, | |||
1099 | " 0x%p\n", current->comm, | 1104 | " 0x%p\n", current->comm, |
1100 | sdev)); | 1105 | sdev)); |
1101 | rtn = scsi_try_bus_device_reset(bdr_scmd); | 1106 | rtn = scsi_try_bus_device_reset(bdr_scmd); |
1102 | if (rtn == SUCCESS) { | 1107 | if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { |
1103 | if (!scsi_device_online(sdev) || | 1108 | if (!scsi_device_online(sdev) || |
1109 | rtn == FAST_IO_FAIL || | ||
1104 | !scsi_eh_tur(bdr_scmd)) { | 1110 | !scsi_eh_tur(bdr_scmd)) { |
1105 | list_for_each_entry_safe(scmd, next, | 1111 | list_for_each_entry_safe(scmd, next, |
1106 | work_q, eh_entry) { | 1112 | work_q, eh_entry) { |
@@ -1163,10 +1169,11 @@ static int scsi_eh_target_reset(struct Scsi_Host *shost, | |||
1163 | "to target %d\n", | 1169 | "to target %d\n", |
1164 | current->comm, id)); | 1170 | current->comm, id)); |
1165 | rtn = scsi_try_target_reset(tgtr_scmd); | 1171 | rtn = scsi_try_target_reset(tgtr_scmd); |
1166 | if (rtn == SUCCESS) { | 1172 | if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { |
1167 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { | 1173 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { |
1168 | if (id == scmd_id(scmd)) | 1174 | if (id == scmd_id(scmd)) |
1169 | if (!scsi_device_online(scmd->device) || | 1175 | if (!scsi_device_online(scmd->device) || |
1176 | rtn == FAST_IO_FAIL || | ||
1170 | !scsi_eh_tur(tgtr_scmd)) | 1177 | !scsi_eh_tur(tgtr_scmd)) |
1171 | scsi_eh_finish_cmd(scmd, | 1178 | scsi_eh_finish_cmd(scmd, |
1172 | done_q); | 1179 | done_q); |
@@ -1222,10 +1229,11 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost, | |||
1222 | " %d\n", current->comm, | 1229 | " %d\n", current->comm, |
1223 | channel)); | 1230 | channel)); |
1224 | rtn = scsi_try_bus_reset(chan_scmd); | 1231 | rtn = scsi_try_bus_reset(chan_scmd); |
1225 | if (rtn == SUCCESS) { | 1232 | if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { |
1226 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { | 1233 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { |
1227 | if (channel == scmd_channel(scmd)) | 1234 | if (channel == scmd_channel(scmd)) |
1228 | if (!scsi_device_online(scmd->device) || | 1235 | if (!scsi_device_online(scmd->device) || |
1236 | rtn == FAST_IO_FAIL || | ||
1229 | !scsi_eh_tur(scmd)) | 1237 | !scsi_eh_tur(scmd)) |
1230 | scsi_eh_finish_cmd(scmd, | 1238 | scsi_eh_finish_cmd(scmd, |
1231 | done_q); | 1239 | done_q); |
@@ -1259,9 +1267,10 @@ static int scsi_eh_host_reset(struct list_head *work_q, | |||
1259 | , current->comm)); | 1267 | , current->comm)); |
1260 | 1268 | ||
1261 | rtn = scsi_try_host_reset(scmd); | 1269 | rtn = scsi_try_host_reset(scmd); |
1262 | if (rtn == SUCCESS) { | 1270 | if (rtn == SUCCESS || rtn == FAST_IO_FAIL) { |
1263 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { | 1271 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { |
1264 | if (!scsi_device_online(scmd->device) || | 1272 | if (!scsi_device_online(scmd->device) || |
1273 | rtn == FAST_IO_FAIL || | ||
1265 | (!scsi_eh_try_stu(scmd) && !scsi_eh_tur(scmd)) || | 1274 | (!scsi_eh_try_stu(scmd) && !scsi_eh_tur(scmd)) || |
1266 | !scsi_eh_tur(scmd)) | 1275 | !scsi_eh_tur(scmd)) |
1267 | scsi_eh_finish_cmd(scmd, done_q); | 1276 | scsi_eh_finish_cmd(scmd, done_q); |