summaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/remote_device.c
diff options
context:
space:
mode:
authorJeff Skirvin <jeffrey.d.skirvin@intel.com>2012-03-08 22:42:08 -0800
committerDan Williams <dan.j.williams@intel.com>2012-05-17 14:33:43 -0700
commit1f05388933cb6e57ed9e51768c194ff145002f3b (patch)
tree4e4bae448746ffdb0196b8e16a4f25893eb10855 /drivers/scsi/isci/remote_device.c
parentc5457a82a404db3c447df22e6425c5c140c4bee1 (diff)
isci: Don't wait for an RNC suspend if it's being destroyed.
Make sure that the wait for suspend can handle the RNC destruction case. 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/remote_device.c')
-rw-r--r--drivers/scsi/isci/remote_device.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index be9f0e0be4ff..68ab4fb9032e 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -142,7 +142,12 @@ static bool isci_compare_suspendcount(
u32 localcount)
{
smp_rmb();
- return localcount != idev->rnc.suspend_count;
+
+ /* Check for a change in the suspend count, or the RNC
+ * being destroyed.
+ */
+ return (localcount != idev->rnc.suspend_count)
+ || sci_remote_node_context_is_being_destroyed(&idev->rnc);
}
static bool isci_check_reqterm(
@@ -1380,7 +1385,8 @@ enum sci_status isci_remote_device_resume_from_abort(
struct isci_remote_device *idev)
{
unsigned long flags;
- enum sci_status status;
+ enum sci_status status = SCI_SUCCESS;
+ int destroyed;
spin_lock_irqsave(&ihost->scic_lock, flags);
/* Preserve any current resume callbacks, for instance from other
@@ -1390,11 +1396,17 @@ enum sci_status isci_remote_device_resume_from_abort(
idev->abort_resume_cbparam = idev->rnc.user_cookie;
set_bit(IDEV_ABORT_PATH_RESUME_PENDING, &idev->flags);
clear_bit(IDEV_ABORT_PATH_ACTIVE, &idev->flags);
- status = sci_remote_device_resume(
+ destroyed = sci_remote_node_context_is_being_destroyed(&idev->rnc);
+ if (!destroyed)
+ status = sci_remote_device_resume(
idev, isci_remote_device_resume_from_abort_complete,
idev);
spin_unlock_irqrestore(&ihost->scic_lock, flags);
- isci_remote_device_wait_for_resume_from_abort(ihost, idev);
+ if (!destroyed)
+ isci_remote_device_wait_for_resume_from_abort(ihost, idev);
+ else
+ clear_bit(IDEV_ABORT_PATH_RESUME_PENDING, &idev->flags);
+
return status;
}