From 31a38ef0a5ad12dbe262ca55d0a905657be55a8d Mon Sep 17 00:00:00 2001 From: Jeff Skirvin Date: Thu, 8 Mar 2012 22:42:01 -0800 Subject: 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 Signed-off-by: Dan Williams --- drivers/scsi/isci/task.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/scsi/isci/task.c') 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); -- cgit v1.2.2