diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2011-03-31 16:10:34 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:36 -0400 |
commit | f219f010a355487638bf2fff4724a420e7158fd2 (patch) | |
tree | b35a711226078cdfb8a8c4c730a1d05832a5791e /drivers/scsi/isci/task.c | |
parent | de728b7d72089330603819a74255a0469780fd0e (diff) |
isci: Properly handle requests in the "aborting" state.
When a TMF times-out, the request is set back to "aborting".
Requests in the "aborting" state must be terminated when
LUN and device resets occur.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/task.c')
-rw-r--r-- | drivers/scsi/isci/task.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 7e9668402559..338f08ec4d8e 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -903,7 +903,9 @@ static void isci_terminate_request( | |||
903 | new_request_state | 903 | new_request_state |
904 | ); | 904 | ); |
905 | 905 | ||
906 | if ((old_state == started) || (old_state == completed)) { | 906 | if ((old_state == started) || |
907 | (old_state == completed) || | ||
908 | (old_state == aborting)) { | ||
907 | 909 | ||
908 | /* If the old_state is started: | 910 | /* If the old_state is started: |
909 | * This request was not already being aborted. If it had been, | 911 | * This request was not already being aborted. If it had been, |
@@ -920,6 +922,10 @@ static void isci_terminate_request( | |||
920 | * This request completed from the SCU hardware perspective | 922 | * This request completed from the SCU hardware perspective |
921 | * and now just needs cleaning up in terms of freeing the | 923 | * and now just needs cleaning up in terms of freeing the |
922 | * request and potentially calling up to libsas. | 924 | * request and potentially calling up to libsas. |
925 | * | ||
926 | * If old_state == aborting: | ||
927 | * This request has already gone through a TMF timeout, but may | ||
928 | * not have been terminated; needs cleaning up at least. | ||
923 | */ | 929 | */ |
924 | isci_terminate_request_core(isci_host, isci_device, | 930 | isci_terminate_request_core(isci_host, isci_device, |
925 | isci_request); | 931 | isci_request); |
@@ -1297,14 +1303,16 @@ int isci_task_abort_task(struct sas_task *task) | |||
1297 | 1303 | ||
1298 | spin_lock_irqsave(&isci_host->scic_lock, flags); | 1304 | spin_lock_irqsave(&isci_host->scic_lock, flags); |
1299 | 1305 | ||
1300 | /* Check the request status and change to "aborting" if currently | 1306 | /* Check the request status and change to "aborted" if currently |
1301 | * "starting"; if true then set the I/O kernel completion | 1307 | * "starting"; if true then set the I/O kernel completion |
1302 | * struct that will be triggered when the request completes. | 1308 | * struct that will be triggered when the request completes. |
1303 | */ | 1309 | */ |
1304 | old_state = isci_task_validate_request_to_abort( | 1310 | old_state = isci_task_validate_request_to_abort( |
1305 | old_request, isci_host, isci_device, | 1311 | old_request, isci_host, isci_device, |
1306 | &aborted_io_completion); | 1312 | &aborted_io_completion); |
1307 | if ((old_state != started) && (old_state != completed)) { | 1313 | if ((old_state != started) && |
1314 | (old_state != completed) && | ||
1315 | (old_state != aborting)) { | ||
1308 | 1316 | ||
1309 | spin_unlock_irqrestore(&isci_host->scic_lock, flags); | 1317 | spin_unlock_irqrestore(&isci_host->scic_lock, flags); |
1310 | 1318 | ||