From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 12/18] [PATCH] libata-link: implement ata_link_abort()
Date: Mon, 16 Oct 2006 07:54:41 +0900 [thread overview]
Message-ID: <11609528814161-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1160952879581-git-send-email-htejun@gmail.com>
Implement ata_link_abort().
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-core.c | 1 +
drivers/ata/libata-eh.c | 50 ++++++++++++++++++++++++++++++++-------------
include/linux/libata.h | 1 +
3 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 67e08e3..2813bb8 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6349,6 +6349,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_device_resume
EXPORT_SYMBOL_GPL(ata_eng_timeout);
EXPORT_SYMBOL_GPL(ata_port_schedule_eh);
+EXPORT_SYMBOL_GPL(ata_link_abort);
EXPORT_SYMBOL_GPL(ata_port_abort);
EXPORT_SYMBOL_GPL(ata_port_freeze);
EXPORT_SYMBOL_GPL(ata_eh_freeze_port);
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9b16bc6..d1927a7 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -533,19 +533,7 @@ void ata_port_schedule_eh(struct ata_por
DPRINTK("port EH scheduled\n");
}
-/**
- * ata_port_abort - abort all qc's on the port
- * @ap: ATA port to abort qc's for
- *
- * Abort all active qc's of @ap and schedule EH.
- *
- * LOCKING:
- * spin_lock_irqsave(host lock)
- *
- * RETURNS:
- * Number of aborted qc's.
- */
-int ata_port_abort(struct ata_port *ap)
+static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link)
{
int tag, nr_aborted = 0;
@@ -554,7 +542,7 @@ int ata_port_abort(struct ata_port *ap)
for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag);
- if (qc) {
+ if (qc && (!link || qc->dev->link == link)) {
qc->flags |= ATA_QCFLAG_FAILED;
ata_qc_complete(qc);
nr_aborted++;
@@ -568,6 +556,40 @@ int ata_port_abort(struct ata_port *ap)
}
/**
+ * ata_link_abort - abort all qc's on the link
+ * @link: ATA link to abort qc's for
+ *
+ * Abort all active qc's active on @link and schedule EH.
+ *
+ * LOCKING:
+ * spin_lock_irqsave(host lock)
+ *
+ * RETURNS:
+ * Number of aborted qc's.
+ */
+int ata_link_abort(struct ata_link *link)
+{
+ return ata_do_link_abort(link->ap, link);
+}
+
+/**
+ * ata_port_abort - abort all qc's on the port
+ * @ap: ATA port to abort qc's for
+ *
+ * Abort all active qc's of @ap and schedule EH.
+ *
+ * LOCKING:
+ * spin_lock_irqsave(host_set lock)
+ *
+ * RETURNS:
+ * Number of aborted qc's.
+ */
+int ata_port_abort(struct ata_port *ap)
+{
+ return ata_do_link_abort(ap, NULL);
+}
+
+/**
* __ata_port_freeze - freeze port
* @ap: ATA port to freeze
*
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 02e21a7..e4fd809 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -890,6 +890,7 @@ #endif /* CONFIG_PCI */
extern void ata_eng_timeout(struct ata_port *ap);
extern void ata_port_schedule_eh(struct ata_port *ap);
+extern int ata_link_abort(struct ata_link *link);
extern int ata_port_abort(struct ata_port *ap);
extern int ata_port_freeze(struct ata_port *ap);
--
1.4.2.3
next prev parent reply other threads:[~2006-10-15 22:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-15 22:54 [PATCHSET] implement ata_link, take 3 Tejun Heo
2006-10-15 22:54 ` [PATCH 1/18] [PATCH] libata: generate hotplug event on SError read failure Tejun Heo
2006-10-15 22:54 ` [PATCH 4/18] [PATCH] libata-link: introduce ata_link Tejun Heo
2006-10-15 22:54 ` [PATCH 7/18] [PATCH] libata-link: linkify EH action helpers Tejun Heo
2006-10-15 22:54 ` [PATCH 8/18] [PATCH] libata-link: linkify reset Tejun Heo
2006-10-15 22:54 ` [PATCH 5/18] [PATCH] libata-link: implement and use link/device iterators Tejun Heo
2006-10-15 22:54 ` [PATCH 3/18] [PATCH] libata-link: add PMP related ATA constants Tejun Heo
2006-10-15 22:54 ` [PATCH 10/18] [PATCH] libata-link: separate out link initialization functions Tejun Heo
2006-11-01 2:26 ` Jeff Garzik
2006-10-15 22:54 ` [PATCH 6/18] [PATCH] libata-link: linkify PHY-related functions Tejun Heo
2006-10-15 22:54 ` [PATCH 2/18] [PATCH] libata-link: separate out ata_eh_handle_dev_fail() Tejun Heo
2006-10-15 22:54 ` [PATCH 9/18] [PATCH] libata-link: linkify config/EH related functions Tejun Heo
2006-10-15 22:54 ` [PATCH 11/18] [PATCH] libata-link: implement link->reset_tries Tejun Heo
2006-10-15 22:54 ` [PATCH 14/18] [PATCH] libata-link: update ata_scsi_error() to handle PMP links Tejun Heo
2006-10-15 22:54 ` Tejun Heo [this message]
2006-10-15 22:54 ` [PATCH 13/18] [PATCH] libata-link: add " Tejun Heo
2006-10-15 22:54 ` [PATCH 17/18] [PATCH] libata-link: update hotplug to handle " Tejun Heo
2006-10-15 22:54 ` [PATCH 18/18] [PATCH] libata-link: update Power Management " Tejun Heo
2006-10-15 22:54 ` [PATCH 16/18] [PATCH] libata-link: update EH to deal with " Tejun Heo
2006-10-15 22:54 ` [PATCH 15/18] [PATCH] libata-link: update ata_dev_configure() " Tejun Heo
2006-10-15 22:56 ` [PATCHSET] implement ata_link, take 3 Tejun Heo
2006-11-01 2:26 ` Jeff Garzik
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=11609528814161-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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).