From 3ef768c6c0caa83b9fe66f19a18898ed0315ac36 Mon Sep 17 00:00:00 2001 From: Jeff Skirvin Date: Mon, 12 Mar 2012 17:29:51 -0700 Subject: [PATCH] isci: Manage the IREQ_NO_AUTO_FREE_TAG under scic_lock. Since there is a possibilty of a timeout waiting for the RNC suspension, handle the exit case from the task termination under scic_lock, and leave the tag allocated if the termination timed-out. Signed-off-by: Jeff Skirvin Signed-off-by: Dan Williams --- drivers/scsi/isci/remote_device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index 48765aa84328..a3a6487264ea 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c @@ -243,8 +243,11 @@ enum sci_status isci_remote_device_terminate_requests( idev->rnc.destination_state, ireq, ireq->flags); } + spin_lock_irqsave(&ihost->scic_lock, flags); clear_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags); - isci_free_tag(ihost, ireq->io_tag); + if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags)) + isci_free_tag(ihost, ireq->io_tag); + spin_unlock_irqrestore(&ihost->scic_lock, flags); } else { /* Terminate all TCs. */ sci_remote_device_terminate_requests(idev); -- 2.20.1