diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2011-03-07 18:40:47 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 06:55:30 -0400 |
commit | aa14510295d3d87431c915c0b2bc5dd3af7f2c35 (patch) | |
tree | 7dddb3f3ab2fa9c90d0155f18230bb9e630f6018 | |
parent | 50e7f9b5a9ae4a763b2c27500807cf237faca9b0 (diff) |
isci: Always set response/status for requests going into the error path.
In the case of I/O requests being failed because of a required device
reset condition, set the response and status to indicate an I/O failure.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/request.c | 28 | ||||
-rw-r--r-- | drivers/scsi/isci/task.h | 13 |
2 files changed, 25 insertions, 16 deletions
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index f19a952754b9..015643104311 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
@@ -809,11 +809,11 @@ static void isci_task_save_for_upper_layer_completion( | |||
809 | 809 | ||
810 | /* Normal notification (task_done) */ | 810 | /* Normal notification (task_done) */ |
811 | dev_dbg(&host->pdev->dev, | 811 | dev_dbg(&host->pdev->dev, |
812 | "%s: Normal - task = %p, response=%d, status=%d\n", | 812 | "%s: Normal - task = %p, response=%d (%d), status=%d (%d)\n", |
813 | __func__, | 813 | __func__, |
814 | task, | 814 | task, |
815 | response, | 815 | task->task_status.resp, response, |
816 | status); | 816 | task->task_status.stat, status); |
817 | /* Add to the completed list. */ | 817 | /* Add to the completed list. */ |
818 | list_add(&request->completed_node, | 818 | list_add(&request->completed_node, |
819 | &host->requests_to_complete); | 819 | &host->requests_to_complete); |
@@ -827,11 +827,11 @@ static void isci_task_save_for_upper_layer_completion( | |||
827 | * already in the abort path. | 827 | * already in the abort path. |
828 | */ | 828 | */ |
829 | dev_warn(&host->pdev->dev, | 829 | dev_warn(&host->pdev->dev, |
830 | "%s: Aborted - task = %p, response=%d, status=%d\n", | 830 | "%s: Aborted - task = %p, response=%d (%d), status=%d (%d)\n", |
831 | __func__, | 831 | __func__, |
832 | task, | 832 | task, |
833 | response, | 833 | task->task_status.resp, response, |
834 | status); | 834 | task->task_status.stat, status); |
835 | 835 | ||
836 | /* Wake up whatever process was waiting for this | 836 | /* Wake up whatever process was waiting for this |
837 | * request to complete. | 837 | * request to complete. |
@@ -850,11 +850,11 @@ static void isci_task_save_for_upper_layer_completion( | |||
850 | case isci_perform_error_io_completion: | 850 | case isci_perform_error_io_completion: |
851 | /* Use sas_task_abort */ | 851 | /* Use sas_task_abort */ |
852 | dev_warn(&host->pdev->dev, | 852 | dev_warn(&host->pdev->dev, |
853 | "%s: Error - task = %p, response=%d, status=%d\n", | 853 | "%s: Error - task = %p, response=%d (%d), status=%d (%d)\n", |
854 | __func__, | 854 | __func__, |
855 | task, | 855 | task, |
856 | response, | 856 | task->task_status.resp, response, |
857 | status); | 857 | task->task_status.stat, status); |
858 | /* Add to the aborted list. */ | 858 | /* Add to the aborted list. */ |
859 | list_add(&request->completed_node, | 859 | list_add(&request->completed_node, |
860 | &host->requests_to_errorback); | 860 | &host->requests_to_errorback); |
@@ -862,11 +862,11 @@ static void isci_task_save_for_upper_layer_completion( | |||
862 | 862 | ||
863 | default: | 863 | default: |
864 | dev_warn(&host->pdev->dev, | 864 | dev_warn(&host->pdev->dev, |
865 | "%s: Unknown - task = %p, response=%d, status=%d\n", | 865 | "%s: Unknown - task = %p, response=%d (%d), status=%d (%d)\n", |
866 | __func__, | 866 | __func__, |
867 | task, | 867 | task, |
868 | response, | 868 | task->task_status.resp, response, |
869 | status); | 869 | task->task_status.stat, status); |
870 | 870 | ||
871 | /* Add to the error to libsas list. */ | 871 | /* Add to the error to libsas list. */ |
872 | list_add(&request->completed_node, | 872 | list_add(&request->completed_node, |
@@ -1165,6 +1165,10 @@ void isci_request_io_request_complete( | |||
1165 | task->task_state_flags |= SAS_TASK_NEED_DEV_RESET; | 1165 | task->task_state_flags |= SAS_TASK_NEED_DEV_RESET; |
1166 | spin_unlock_irqrestore(&task->task_state_lock, task_flags); | 1166 | spin_unlock_irqrestore(&task->task_state_lock, task_flags); |
1167 | 1167 | ||
1168 | /* Fail the I/O. */ | ||
1169 | response = SAS_TASK_UNDELIVERED; | ||
1170 | status = SAM_STAT_TASK_ABORTED; | ||
1171 | |||
1168 | complete_to_host = isci_perform_error_io_completion; | 1172 | complete_to_host = isci_perform_error_io_completion; |
1169 | request->complete_in_target = false; | 1173 | request->complete_in_target = false; |
1170 | break; | 1174 | break; |
diff --git a/drivers/scsi/isci/task.h b/drivers/scsi/isci/task.h index e1c9c8f04050..b84bedd94601 100644 --- a/drivers/scsi/isci/task.h +++ b/drivers/scsi/isci/task.h | |||
@@ -302,14 +302,19 @@ isci_task_set_completion_status( | |||
302 | 302 | ||
303 | spin_lock_irqsave(&task->task_state_lock, flags); | 303 | spin_lock_irqsave(&task->task_state_lock, flags); |
304 | 304 | ||
305 | task->task_status.resp = response; | ||
306 | task->task_status.stat = status; | ||
307 | |||
308 | /* If a device reset is being indicated, make sure the I/O | 305 | /* If a device reset is being indicated, make sure the I/O |
309 | * is in the error path. | 306 | * is in the error path. |
310 | */ | 307 | */ |
311 | if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) | 308 | if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) { |
309 | |||
310 | /* Fail the I/O to make sure it goes into the error path. */ | ||
311 | response = SAS_TASK_UNDELIVERED; | ||
312 | status = SAM_STAT_TASK_ABORTED; | ||
313 | |||
312 | task_notification_selection = isci_perform_error_io_completion; | 314 | task_notification_selection = isci_perform_error_io_completion; |
315 | } | ||
316 | task->task_status.resp = response; | ||
317 | task->task_status.stat = status; | ||
313 | 318 | ||
314 | switch (task_notification_selection) { | 319 | switch (task_notification_selection) { |
315 | 320 | ||