Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254543
b: refs/heads/master
c: cde76fb
h: refs/heads/master
i:
  254541: 059ef1c
  254539: 1180472
  254535: 61ab749
  254527: c6afc74
v: v3
  • Loading branch information
Jeff Skirvin authored and Dan Williams committed Jul 3, 2011
1 parent f0dc868 commit 30756fc
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61aaff49e20fdb700f1300a49962bc76effc77fc
refs/heads/master: cde76fbf1f27551a08860227765ae8d5026ac0d9
35 changes: 31 additions & 4 deletions trunk/drivers/scsi/isci/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -2508,9 +2508,16 @@ static void isci_request_handle_controller_specific_errors(
/* Task in the target is not done. */
*response_ptr = SAS_TASK_UNDELIVERED;
*status_ptr = SAM_STAT_TASK_ABORTED;
request->complete_in_target = false;

*complete_to_host_ptr = isci_perform_error_io_completion;
if (task->task_proto == SAS_PROTOCOL_SMP) {
request->complete_in_target = true;

*complete_to_host_ptr = isci_perform_normal_io_completion;
} else {
request->complete_in_target = false;

*complete_to_host_ptr = isci_perform_error_io_completion;
}
break;
}
}
Expand Down Expand Up @@ -2882,6 +2889,21 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
request->complete_in_target = false;
break;

case SCI_FAILURE_RETRY_REQUIRED:

/* Fail the I/O so it can be retried. */
response = SAS_TASK_UNDELIVERED;
if ((isci_device->status == isci_stopping) ||
(isci_device->status == isci_stopped))
status = SAS_DEVICE_UNKNOWN;
else
status = SAS_ABORTED_TASK;

complete_to_host = isci_perform_normal_io_completion;
request->complete_in_target = true;
break;


default:
/* Catch any otherwise unhandled error codes here. */
dev_warn(&isci_host->pdev->dev,
Expand All @@ -2901,8 +2923,13 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
else
status = SAS_ABORTED_TASK;

complete_to_host = isci_perform_error_io_completion;
request->complete_in_target = false;
if (SAS_PROTOCOL_SMP == task->task_proto) {
request->complete_in_target = true;
complete_to_host = isci_perform_normal_io_completion;
} else {
request->complete_in_target = false;
complete_to_host = isci_perform_error_io_completion;
}
break;
}
break;
Expand Down
27 changes: 21 additions & 6 deletions trunk/drivers/scsi/isci/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,27 @@ isci_task_set_completion_status(
task->task_status.stat = status;

switch (task_notification_selection) {

case isci_perform_error_io_completion:

if (task->task_proto == SAS_PROTOCOL_SMP) {
/* There is no error escalation in the SMP case.
* Convert to a normal completion to avoid the
* timeout in the discovery path and to let the
* next action take place quickly.
*/
task_notification_selection
= isci_perform_normal_io_completion;

/* Fall through to the normal case... */
} else {
/* Use sas_task_abort */
/* Leave SAS_TASK_STATE_DONE clear
* Leave SAS_TASK_AT_INITIATOR set.
*/
break;
}

case isci_perform_aborted_io_completion:
/* This path can occur with task-managed requests as well as
* requests terminated because of LUN or device resets.
Expand All @@ -313,12 +334,6 @@ isci_task_set_completion_status(
default:
WARN_ONCE(1, "unknown task_notification_selection: %d\n",
task_notification_selection);
/* Fall through to the error case... */
case isci_perform_error_io_completion:
/* Use sas_task_abort */
/* Leave SAS_TASK_STATE_DONE clear
* Leave SAS_TASK_AT_INITIATOR set.
*/
break;
}

Expand Down

0 comments on commit 30756fc

Please sign in to comment.