aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/task.c
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2012-03-09 01:42:00 -0500
committerDan Williams <dan.j.williams@intel.com>2012-05-17 17:33:40 -0400
commit08c031e4e3294a66a64074e12482abda846dd39c (patch)
treec7fb3392487ed731a39a75239850be657009aa56 /drivers/scsi/isci/task.c
parent9608b6408e637abeec101abb6aebd3343f0ebac4 (diff)
isci: Make sure all TCs are terminated and cleaned in LUN reset.
In the libsas error path, SATA disks require extra handling in libata to recover operation. However, libsas expects to be able to immediately recover all outstanding I/O once the error handler escalation stops. This patch fixes the condition where the libata error handler is scheduled for operation but libsas has already deleted the outstanding sas_tasks. 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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index 222fb0de4d5..5d738fd5f88 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -439,16 +439,18 @@ int isci_task_lu_reset(struct domain_device *dev, u8 *lun)
439 goto out; 439 goto out;
440 } 440 }
441 441
442 /* Suspend the RNC, kill all TCs */
443 if (isci_remote_device_suspend_terminate(ihost, idev, NULL)
444 != SCI_SUCCESS) {
445 /* The suspend/terminate only fails if isci_get_device fails */
446 ret = TMF_RESP_FUNC_FAILED;
447 goto out;
448 }
449 /* All pending I/Os have been terminated and cleaned up. */
442 if (dev_is_sata(dev)) { 450 if (dev_is_sata(dev)) {
443 sas_ata_schedule_reset(dev); 451 sas_ata_schedule_reset(dev);
444 ret = TMF_RESP_FUNC_COMPLETE; 452 ret = TMF_RESP_FUNC_COMPLETE;
445 } else { 453 } else {
446 /* Suspend the RNC, kill all TCs */
447 if (isci_remote_device_suspend_terminate(ihost, idev, NULL)
448 != SCI_SUCCESS) {
449 ret = TMF_RESP_FUNC_FAILED;
450 goto out;
451 }
452 /* Send the task management part of the reset. */ 454 /* Send the task management part of the reset. */
453 ret = isci_task_send_lu_reset_sas(ihost, idev, lun); 455 ret = isci_task_send_lu_reset_sas(ihost, idev, lun);
454 } 456 }