aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/task.c
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2012-03-08 22:42:01 -0800
committerDan Williams <dan.j.williams@intel.com>2012-05-17 14:33:41 -0700
commit31a38ef0a5ad12dbe262ca55d0a905657be55a8d (patch)
treecf05c3c5fb97670711e58edc6708d7f52e02f418 /drivers/scsi/isci/task.c
parent08c031e4e3294a66a64074e12482abda846dd39c (diff)
isci: Implement waiting for suspend in the abort path.
In order to prevent a device from receiving an I/O request while still in an RNC suspending or resuming state (and therefore failing that I/O back to libsas with a reset required status) wait for the RNC state change before proceding in the abort path. 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, 7 insertions, 7 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index 5d738fd5f882..c1c6dd0473ae 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -317,11 +317,11 @@ static int isci_task_execute_tmf(struct isci_host *ihost,
spin_unlock_irqrestore(&ihost->scic_lock, flags);
goto err_tci;
}
- /* The RNC must be unsuspended before the TMF can get a response. */
- sci_remote_device_resume(idev, NULL, NULL);
-
spin_unlock_irqrestore(&ihost->scic_lock, flags);
+ /* The RNC must be unsuspended before the TMF can get a response. */
+ isci_remote_device_resume_from_abort(ihost, idev);
+
/* Wait for the TMF to complete, or a timeout. */
timeleft = wait_for_completion_timeout(&completion,
msecs_to_jiffies(timeout_ms));
@@ -554,11 +554,11 @@ int isci_task_abort_task(struct sas_task *task)
sas_protocol_ata(task->task_proto) ||
test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags)) {
- /* No task to send, so explicitly resume the device here */
- sci_remote_device_resume(idev, NULL, NULL);
-
spin_unlock_irqrestore(&ihost->scic_lock, flags);
+ /* No task to send, so explicitly resume the device here */
+ isci_remote_device_resume_from_abort(ihost, idev);
+
dev_warn(&ihost->pdev->dev,
"%s: %s request"
" or complete_in_target (%d), thus no TMF\n",
@@ -757,7 +757,7 @@ static int isci_reset_device(struct isci_host *ihost,
reset_stat = sas_phy_reset(phy, !dev_is_sata(dev));
/* Explicitly resume the RNC here, since there was no task sent. */
- isci_remote_device_resume(ihost, idev, NULL, NULL);
+ isci_remote_device_resume_from_abort(ihost, idev);
dev_dbg(&ihost->pdev->dev, "%s: idev %p complete, reset_stat=%d.\n",
__func__, idev, reset_stat);