From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, albertcc@tw.ibm.com,
linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH] libata: implement ata_eh_determine_qc()
Date: Mon, 3 Apr 2006 12:40:58 +0900 [thread overview]
Message-ID: <11440356582621-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11440356574107-git-send-email-htejun@gmail.com>
Implement EH helper ata_eh_determine_qc(). This function determines
which is the offending qc and loads TF registers for the qc.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/scsi/libata-core.c | 1 +
drivers/scsi/libata-eh.c | 24 ++++++++++++++++++++++++
include/linux/libata.h | 2 ++
3 files changed, 27 insertions(+), 0 deletions(-)
3864377b3160cd8523dd6d752b6dd79cc3464967
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index e6dec59..06bf7f4 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -5279,3 +5279,4 @@ EXPORT_SYMBOL_GPL(ata_eng_timeout);
EXPORT_SYMBOL_GPL(ata_eh_schedule_port);
EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
EXPORT_SYMBOL_GPL(ata_eh_qc_retry);
+EXPORT_SYMBOL_GPL(ata_eh_determine_qc);
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index c4ef2dd..7781f67 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -526,3 +526,27 @@ static unsigned int atapi_eh_request_sen
return ata_exec_internal(ap, dev, &tf, cdb, DMA_FROM_DEVICE,
sense_buf, SCSI_SENSE_BUFFERSIZE);
}
+
+/**
+ * ata_eh_determine_qc - Determine which qc caused error
+ * @ap: port which failed
+ * @tf: resulting taskfile registers of the failed command
+ *
+ * Determine which qc caused failure and read associated tf
+ * registers.
+ *
+ * LOCKING:
+ * Kernel thread context (may sleep)
+ *
+ * RETURNS:
+ * Pointer to the failed qc.
+ */
+struct ata_queued_cmd * ata_eh_determine_qc(struct ata_port *ap,
+ struct ata_taskfile *tf)
+{
+ memset(tf, 0, sizeof(*tf));
+ ap->ops->tf_read(ap, tf);
+
+ return __ata_qc_from_tag(ap, ap->active_tag);
+}
+
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 7eeb023..789dd75 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -684,6 +684,8 @@ extern void ata_eng_timeout(struct ata_p
extern void ata_eh_schedule_port(struct ata_port *ap, unsigned int flags);
extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
+extern struct ata_queued_cmd * ata_eh_determine_qc(struct ata_port *ap,
+ struct ata_taskfile *tf);
static inline int
--
1.2.4
next prev parent reply other threads:[~2006-04-03 3:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-03 3:40 [PATCHSET] new EH implementation Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: add constants and flags to be used by EH Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement ata_ering Tejun Heo
2006-04-03 3:40 ` [PATCH] ata_piix: convert to new EH Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement EH utility functions Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: add per-dev ata_ering Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement EH methods for BMDMA controllers Tejun Heo
2006-04-03 3:40 ` Tejun Heo [this message]
2006-04-03 3:40 ` [PATCH] libata: implement ata_eh_revive() Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement ata_eh_report() Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement ata_eh_finish_qcs() Tejun Heo
2006-04-03 3:40 ` [PATCH] libata: implement ata_eh_autopsy() Tejun Heo
2006-04-03 3:40 ` [PATCH] ahci: convert to new EH Tejun Heo
2006-04-03 3:40 ` [PATCH] sata_sil: " Tejun Heo
2006-04-03 3:43 ` [PATCHSET] new EH implementation Tejun Heo
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=11440356582621-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.