aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/task.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/task.c')
-rw-r--r--drivers/scsi/isci/task.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index 22f6fe171111..d1a46710f4a7 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -558,15 +558,15 @@ static void isci_terminate_request_core(
558 : NULL; 558 : NULL;
559 559
560 /* Note that we are not going to control 560 /* Note that we are not going to control
561 * the target to abort the request. 561 * the target to abort the request.
562 */ 562 */
563 isci_request->complete_in_target = true; 563 set_bit(IREQ_COMPLETE_IN_TARGET, &isci_request->flags);
564 564
565 /* Make sure the request wasn't just sitting around signalling 565 /* Make sure the request wasn't just sitting around signalling
566 * device condition (if the request handle is NULL, then the 566 * device condition (if the request handle is NULL, then the
567 * request completed but needed additional handling here). 567 * request completed but needed additional handling here).
568 */ 568 */
569 if (!isci_request->terminated) { 569 if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) {
570 was_terminated = true; 570 was_terminated = true;
571 needs_cleanup_handling = true; 571 needs_cleanup_handling = true;
572 status = scic_controller_terminate_request( 572 status = scic_controller_terminate_request(
@@ -609,7 +609,7 @@ static void isci_terminate_request_core(
609 flags); 609 flags);
610 610
611 /* Check for state changes. */ 611 /* Check for state changes. */
612 if (!isci_request->terminated) { 612 if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) {
613 613
614 /* The best we can do is to have the 614 /* The best we can do is to have the
615 * request die a silent death if it 615 * request die a silent death if it
@@ -1098,9 +1098,8 @@ int isci_task_abort_task(struct sas_task *task)
1098 ret = TMF_RESP_FUNC_COMPLETE; 1098 ret = TMF_RESP_FUNC_COMPLETE;
1099 goto out; 1099 goto out;
1100 } 1100 }
1101 if ((task->task_proto == SAS_PROTOCOL_SMP) 1101 if (task->task_proto == SAS_PROTOCOL_SMP ||
1102 || old_request->complete_in_target 1102 test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags)) {
1103 ) {
1104 1103
1105 spin_unlock_irqrestore(&isci_host->scic_lock, flags); 1104 spin_unlock_irqrestore(&isci_host->scic_lock, flags);
1106 1105
@@ -1108,7 +1107,7 @@ int isci_task_abort_task(struct sas_task *task)
1108 "%s: SMP request (%d)" 1107 "%s: SMP request (%d)"
1109 " or complete_in_target (%d), thus no TMF\n", 1108 " or complete_in_target (%d), thus no TMF\n",
1110 __func__, (task->task_proto == SAS_PROTOCOL_SMP), 1109 __func__, (task->task_proto == SAS_PROTOCOL_SMP),
1111 old_request->complete_in_target); 1110 test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags));
1112 1111
1113 /* Set the state on the task. */ 1112 /* Set the state on the task. */
1114 isci_task_all_done(task); 1113 isci_task_all_done(task);
@@ -1136,7 +1135,7 @@ int isci_task_abort_task(struct sas_task *task)
1136 __func__); 1135 __func__);
1137 } 1136 }
1138 if (ret == TMF_RESP_FUNC_COMPLETE) { 1137 if (ret == TMF_RESP_FUNC_COMPLETE) {
1139 old_request->complete_in_target = true; 1138 set_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags);
1140 1139
1141 /* Clean up the request on our side, and wait for the aborted 1140 /* Clean up the request on our side, and wait for the aborted
1142 * I/O to complete. 1141 * I/O to complete.
@@ -1252,7 +1251,7 @@ isci_task_request_complete(struct isci_host *ihost,
1252 isci_request_change_state(ireq, completed); 1251 isci_request_change_state(ireq, completed);
1253 1252
1254 tmf->status = completion_status; 1253 tmf->status = completion_status;
1255 ireq->complete_in_target = true; 1254 set_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags);
1256 1255
1257 if (tmf->proto == SAS_PROTOCOL_SSP) { 1256 if (tmf->proto == SAS_PROTOCOL_SSP) {
1258 memcpy(&tmf->resp.resp_iu, 1257 memcpy(&tmf->resp.resp_iu,
@@ -1271,7 +1270,7 @@ isci_task_request_complete(struct isci_host *ihost,
1271 /* set the 'terminated' flag handle to make sure it cannot be terminated 1270 /* set the 'terminated' flag handle to make sure it cannot be terminated
1272 * or completed again. 1271 * or completed again.
1273 */ 1272 */
1274 ireq->terminated = true;; 1273 set_bit(IREQ_TERMINATED, &ireq->flags);
1275 1274
1276 isci_request_change_state(ireq, unallocated); 1275 isci_request_change_state(ireq, unallocated);
1277 list_del_init(&ireq->dev_node); 1276 list_del_init(&ireq->dev_node);