public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: JBottomley@parallels.com
Cc: Jeff Skirvin <jeffrey.d.skirvin@intel.com>, linux-scsi@vger.kernel.org
Subject: [PATCH 6/9] isci: Leave requests alone if already terminating.
Date: Fri, 29 Jul 2011 17:17:05 -0700	[thread overview]
Message-ID: <20110730001705.28430.88797.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110730001320.28430.53496.stgit@localhost6.localdomain6>

From: Jeff Skirvin <jeffrey.d.skirvin@intel.com>

Instead of immediately completing any request that has a second
termination call made on it, wait for the TC done/abort HW event.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/isci/request.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index b4cf998..b5d3a8c 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -732,12 +732,20 @@ sci_io_request_terminate(struct isci_request *ireq)
 		sci_change_state(&ireq->sm, SCI_REQ_ABORTING);
 		return SCI_SUCCESS;
 	case SCI_REQ_TASK_WAIT_TC_RESP:
+		/* The task frame was already confirmed to have been
+		 * sent by the SCU HW.  Since the state machine is
+		 * now only waiting for the task response itself,
+		 * abort the request and complete it immediately
+		 * and don't wait for the task response.
+		 */
 		sci_change_state(&ireq->sm, SCI_REQ_ABORTING);
 		sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
 		return SCI_SUCCESS;
 	case SCI_REQ_ABORTING:
-		sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
-		return SCI_SUCCESS;
+		/* If a request has a termination requested twice, return
+		 * a failure indication, since HW confirmation of the first
+		 * abort is still outstanding.
+		 */
 	case SCI_REQ_COMPLETED:
 	default:
 		dev_warn(&ireq->owning_controller->pdev->dev,


  parent reply	other threads:[~2011-07-30  0:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30  0:16 [GIT PATCH 0/9] isci updates for 3.1 Dan Williams
2011-07-30  0:16 ` [PATCH 1/9] isci: fix sata response handling Dan Williams
2011-07-30  0:16 ` [PATCH 2/9] isci: fix 32-bit operation when CONFIG_HIGHMEM64G=n Dan Williams
2011-07-30  0:16 ` [PATCH 3/9] isci: change sas phy timeouts from 54us to 59us Dan Williams
2011-07-30  0:16 ` [PATCH 4/9] isci: Update MAINTAINERS entry for the isci driver Dan Williams
2011-07-30  0:17 ` [PATCH 5/9] isci: Adding documentation to API change and fixup sysfs registration Dan Williams
2011-07-30  0:17 ` Dan Williams [this message]
2011-07-30  0:17 ` [PATCH 7/9] isci: dynamic interrupt coalescing Dan Williams
2011-07-30  0:17 ` [PATCH 8/9] isci: fix event-get pointer increment Dan Williams
2011-07-30  0:17 ` [PATCH 9/9] isci: add version number Dan Williams
2011-07-30 16:55   ` Stefan Richter
2011-08-01 16:24     ` Dan Williams
2011-08-01 17:38       ` Stefan Richter
2011-08-01 17:54         ` James Bottomley
2011-08-01 18:29           ` Stefan Richter
2011-08-01 18:40             ` Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110730001705.28430.88797.stgit@localhost6.localdomain6 \
    --to=dan.j.williams@intel.com \
    --cc=JBottomley@parallels.com \
    --cc=jeffrey.d.skirvin@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox