|
@@ -941,12 +941,6 @@ retry:
|
|
|
|
|
|
|
|
scsi_eh_restore_cmnd(scmd, &ses);
|
|
scsi_eh_restore_cmnd(scmd, &ses);
|
|
|
|
|
|
|
|
- if (scmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
|
|
|
|
|
- struct scsi_driver *sdrv = scsi_cmd_to_driver(scmd);
|
|
|
|
|
- if (sdrv->eh_action)
|
|
|
|
|
- rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return rtn;
|
|
return rtn;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -964,6 +958,16 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
|
|
|
return scsi_send_eh_cmnd(scmd, NULL, 0, scmd->device->eh_timeout, ~0);
|
|
return scsi_send_eh_cmnd(scmd, NULL, 0, scmd->device->eh_timeout, ~0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static int scsi_eh_action(struct scsi_cmnd *scmd, int rtn)
|
|
|
|
|
+{
|
|
|
|
|
+ if (scmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
|
|
|
|
|
+ struct scsi_driver *sdrv = scsi_cmd_to_driver(scmd);
|
|
|
|
|
+ if (sdrv->eh_action)
|
|
|
|
|
+ rtn = sdrv->eh_action(scmd, rtn);
|
|
|
|
|
+ }
|
|
|
|
|
+ return rtn;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* scsi_eh_finish_cmd - Handle a cmd that eh is finished with.
|
|
* scsi_eh_finish_cmd - Handle a cmd that eh is finished with.
|
|
|
* @scmd: Original SCSI cmd that eh has finished.
|
|
* @scmd: Original SCSI cmd that eh has finished.
|
|
@@ -1142,7 +1146,9 @@ static int scsi_eh_test_devices(struct list_head *cmd_list,
|
|
|
|
|
|
|
|
list_for_each_entry_safe(scmd, next, cmd_list, eh_entry)
|
|
list_for_each_entry_safe(scmd, next, cmd_list, eh_entry)
|
|
|
if (scmd->device == sdev) {
|
|
if (scmd->device == sdev) {
|
|
|
- if (finish_cmds)
|
|
|
|
|
|
|
+ if (finish_cmds &&
|
|
|
|
|
+ (try_stu ||
|
|
|
|
|
+ scsi_eh_action(scmd, SUCCESS) == SUCCESS))
|
|
|
scsi_eh_finish_cmd(scmd, done_q);
|
|
scsi_eh_finish_cmd(scmd, done_q);
|
|
|
else
|
|
else
|
|
|
list_move_tail(&scmd->eh_entry, work_q);
|
|
list_move_tail(&scmd->eh_entry, work_q);
|
|
@@ -1283,7 +1289,8 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
|
|
|
!scsi_eh_tur(stu_scmd)) {
|
|
!scsi_eh_tur(stu_scmd)) {
|
|
|
list_for_each_entry_safe(scmd, next,
|
|
list_for_each_entry_safe(scmd, next,
|
|
|
work_q, eh_entry) {
|
|
work_q, eh_entry) {
|
|
|
- if (scmd->device == sdev)
|
|
|
|
|
|
|
+ if (scmd->device == sdev &&
|
|
|
|
|
+ scsi_eh_action(scmd, SUCCESS) == SUCCESS)
|
|
|
scsi_eh_finish_cmd(scmd, done_q);
|
|
scsi_eh_finish_cmd(scmd, done_q);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1350,7 +1357,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
|
|
|
!scsi_eh_tur(bdr_scmd)) {
|
|
!scsi_eh_tur(bdr_scmd)) {
|
|
|
list_for_each_entry_safe(scmd, next,
|
|
list_for_each_entry_safe(scmd, next,
|
|
|
work_q, eh_entry) {
|
|
work_q, eh_entry) {
|
|
|
- if (scmd->device == sdev)
|
|
|
|
|
|
|
+ if (scmd->device == sdev &&
|
|
|
|
|
+ scsi_eh_action(scmd, rtn) != FAILED)
|
|
|
scsi_eh_finish_cmd(scmd,
|
|
scsi_eh_finish_cmd(scmd,
|
|
|
done_q);
|
|
done_q);
|
|
|
}
|
|
}
|