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>
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index 5d738fd..c1c6dd0 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -317,11 +317,11 @@
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 @@
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 @@
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);