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:01 -0500
committerDan Williams <dan.j.williams@intel.com>2012-05-17 17:33:41 -0400
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,
317 spin_unlock_irqrestore(&ihost->scic_lock, flags); 317 spin_unlock_irqrestore(&ihost->scic_lock, flags);
318 goto err_tci; 318 goto err_tci;
319 } 319 }
320 /* The RNC must be unsuspended before the TMF can get a response. */
321 sci_remote_device_resume(idev, NULL, NULL);
322
323 spin_unlock_irqrestore(&ihost->scic_lock, flags); 320 spin_unlock_irqrestore(&ihost->scic_lock, flags);
324 321
322 /* The RNC must be unsuspended before the TMF can get a response. */
323 isci_remote_device_resume_from_abort(ihost, idev);
324
325 /* Wait for the TMF to complete, or a timeout. */ 325 /* Wait for the TMF to complete, or a timeout. */
326 timeleft = wait_for_completion_timeout(&completion, 326 timeleft = wait_for_completion_timeout(&completion,
327 msecs_to_jiffies(timeout_ms)); 327 msecs_to_jiffies(timeout_ms));
@@ -554,11 +554,11 @@ int isci_task_abort_task(struct sas_task *task)
554 sas_protocol_ata(task->task_proto) || 554 sas_protocol_ata(task->task_proto) ||
555 test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags)) { 555 test_bit(IREQ_COMPLETE_IN_TARGET, &old_request->flags)) {
556 556
557 /* No task to send, so explicitly resume the device here */
558 sci_remote_device_resume(idev, NULL, NULL);
559
560 spin_unlock_irqrestore(&ihost->scic_lock, flags); 557 spin_unlock_irqrestore(&ihost->scic_lock, flags);
561 558
559 /* No task to send, so explicitly resume the device here */
560 isci_remote_device_resume_from_abort(ihost, idev);
561
562 dev_warn(&ihost->pdev->dev, 562 dev_warn(&ihost->pdev->dev,
563 "%s: %s request" 563 "%s: %s request"
564 " or complete_in_target (%d), thus no TMF\n", 564 " or complete_in_target (%d), thus no TMF\n",
@@ -757,7 +757,7 @@ static int isci_reset_device(struct isci_host *ihost,
757 reset_stat = sas_phy_reset(phy, !dev_is_sata(dev)); 757 reset_stat = sas_phy_reset(phy, !dev_is_sata(dev));
758 758
759 /* Explicitly resume the RNC here, since there was no task sent. */ 759 /* Explicitly resume the RNC here, since there was no task sent. */
760 isci_remote_device_resume(ihost, idev, NULL, NULL); 760 isci_remote_device_resume_from_abort(ihost, idev);
761 761
762 dev_dbg(&ihost->pdev->dev, "%s: idev %p complete, reset_stat=%d.\n", 762 dev_dbg(&ihost->pdev->dev, "%s: idev %p complete, reset_stat=%d.\n",
763 __func__, idev, reset_stat); 763 __func__, idev, reset_stat);