linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi@vger.kernel.org
Cc: linux-ide@vger.kernel.org, Jacek Danecki <jacek.danecki@intel.com>
Subject: [PATCH 06/18] libsas: add sas_eh_abort_handler
Date: Sun, 06 May 2012 11:18:27 -0700	[thread overview]
Message-ID: <20120506181827.17912.88736.stgit@dwillia2-linux.jf.intel.com> (raw)
In-Reply-To: <20120506181611.17912.3798.stgit@dwillia2-linux.jf.intel.com>

When recovering failed eh-cmnds let the lldd attempt an abort via
scsi_abort_eh_cmnd before escalating.

Reviewed-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/libsas/sas_scsi_host.c |   21 +++++++++++++++++++++
 include/scsi/libsas.h               |    1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 2e0e779..875b871 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -531,6 +531,27 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type, int lun, i
 	return FAILED;
 }
 
+int sas_eh_abort_handler(struct scsi_cmnd *cmd)
+{
+	int res;
+	struct sas_task *task = TO_SAS_TASK(cmd);
+	struct Scsi_Host *host = cmd->device->host;
+	struct sas_internal *i = to_sas_internal(host->transportt);
+
+	if (current != host->ehandler)
+		return FAILED;
+
+	if (!i->dft->lldd_abort_task)
+		return FAILED;
+
+	res = i->dft->lldd_abort_task(task);
+	if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
+		return SUCCESS;
+
+	return FAILED;
+}
+EXPORT_SYMBOL_GPL(sas_eh_abort_handler);
+
 /* Attempt to send a LUN reset message to a device */
 int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
 {
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index ade862a..7c4bd08 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -718,6 +718,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
 void sas_init_dev(struct domain_device *);
 
 void sas_task_abort(struct sas_task *);
+int sas_eh_abort_handler(struct scsi_cmnd *cmd);
 int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
 int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
 


  parent reply	other threads:[~2012-05-06 18:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 18:17 [PATCH 00/18] libsas, sas_ata: update for 3.5 Dan Williams
2012-05-06 18:18 ` [PATCH 01/18] libsas: cleanup spurious calls to scsi_schedule_eh Dan Williams
2012-05-06 18:18 ` [PATCH 02/18] libata, libsas: introduce sched_eh and end_eh port ops Dan Williams
2012-05-06 18:18 ` [PATCH 03/18] scsi: fix eh wakeup (scsi_schedule_eh vs scsi_restart_operations) Dan Williams
2012-05-06 18:18 ` [PATCH 04/18] scsi_transport_sas: fix delete vs scan race Dan Williams
2012-05-06 18:18 ` [PATCH 05/18] libsas: enforce eh strategy handlers only in eh context Dan Williams
2012-05-06 18:18 ` Dan Williams [this message]
2012-05-06 18:18 ` [PATCH 07/18] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler Dan Williams
2012-05-06 18:18 ` [PATCH 08/18] isci: use sas eh strategy handlers Dan Williams
2012-05-06 18:18 ` [PATCH 09/18] libsas: trim sas_task of slow path infrastructure Dan Williams
2012-05-06 18:18 ` [PATCH 10/18] libsas: sas_rediscover_dev did not look at the SMP exec status Dan Williams
2012-05-06 18:18 ` [PATCH 11/18] mvsas: remove unused variable in mvs_task_exec() Dan Williams
2012-05-06 18:18 ` [PATCH 12/18] libata: reset once Dan Williams
2012-05-06 18:19 ` [PATCH 13/18] libsas: continue revalidation Dan Williams
2012-05-06 18:19 ` [PATCH 14/18] libata: export ata_port suspend/resume infrastructure for sas Dan Williams
2012-05-06 18:19 ` [PATCH 15/18] libsas: drop sata port multiplier infrastructure Dan Williams
2012-05-06 18:19 ` [PATCH 16/18] scsi, sd: limit the scope of the async probe domain Dan Williams
2012-05-06 18:19 ` [PATCH 17/18] libsas: suspend / resume support Dan Williams
2012-05-06 18:19 ` [PATCH 18/18] scsi: cleanup setting task state in scsi_error_handler() Dan Williams
2012-05-31 18:12 ` [PATCH 00/18] libsas, sas_ata: update for 3.5 Dan Williams
2012-06-01  4:50   ` Jack Wang

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=20120506181827.17912.88736.stgit@dwillia2-linux.jf.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=jacek.danecki@intel.com \
    --cc=linux-ide@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).