linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATH 1/2] [sata_mv] enable FIS Based Switching when a Port Multiplier is connected: [libata] add fields to store TaskFile before error handling kicks.
@ 2008-10-06  1:11 Gwendal Grignou
  0 siblings, 0 replies; 2+ messages in thread
From: Gwendal Grignou @ 2008-10-06  1:11 UTC (permalink / raw)
  To: Tejun Heo; +Cc: IDE/ATA development list

 Sometimes, it is useful to store ATA Task File in qc->result_tf
 while still on the data path, instead of the error handler triggering
 it with fill_result_tf().


Signed-off-by: Gwendal Grignou <gwendal@google.com>
---
 drivers/ata/libata-core.c |    7 +++++--
 drivers/ata/libata-eh.c   |    1 +
 include/linux/libata.h    |    1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 79e3a8e..fcc7ce2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4607,8 +4607,11 @@ static void fill_result_tf(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;

-	qc->result_tf.flags = qc->tf.flags;
-	ap->ops->qc_fill_rtf(qc);
+	if ((qc->flags & ATA_QCFLAG_RTF_VALID) == 0) {
+		qc->result_tf.flags = qc->tf.flags;
+		qc->flags |= ATA_QCFLAG_RTF_VALID;
+		ap->ops->qc_fill_rtf(qc);
+	}
 }

 static void ata_verify_xfer(struct ata_queued_cmd *qc)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c1db2f2..b5d753e 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1518,6 +1518,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
 	memcpy(&qc->result_tf, &tf, sizeof(tf));
 	qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
 	qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
+	qc->flags |= ATA_QCFLAG_RTF_VALID;
 	ehc->i.err_mask &= ~AC_ERR_DEV;
 }

diff --git a/include/linux/libata.h b/include/linux/libata.h
index 225bfc5..08fc5a9 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -233,6 +233,7 @@ enum {
 	ATA_QCFLAG_FAILED	= (1 << 16), /* cmd failed and is owned by EH */
 	ATA_QCFLAG_SENSE_VALID	= (1 << 17), /* sense data valid */
 	ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
+	ATA_QCFLAG_RTF_VALID	= (1 << 19), /* set when result_tf is valid */

 	/* host set flags */
 	ATA_HOST_SIMPLEX	= (1 << 0),	/* Host is simplex, one DMA channel per
host only */
-- 
1.5.4.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATH 1/2] [sata_mv] enable FIS Based Switching when a Port Multiplier is connected: [libata] add fields to store TaskFile before error handling kicks.
@ 2008-10-06  1:27 Gwendal Grignou
  0 siblings, 0 replies; 2+ messages in thread
From: Gwendal Grignou @ 2008-10-06  1:27 UTC (permalink / raw)
  To: gwendal, tj; +Cc: linux-ide

 Sometimes, it is useful to store ATA Task File in qc->result_tf
 while still on the data path, instead of the error handler triggering
 it.


Signed-off-by: Gwendal Grignou <gwendal@google.com>
---
 drivers/ata/libata-core.c |    7 +++++--
 drivers/ata/libata-eh.c   |    1 +
 include/linux/libata.h    |    1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 79e3a8e..fcc7ce2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4607,8 +4607,11 @@ static void fill_result_tf(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 
-	qc->result_tf.flags = qc->tf.flags;
-	ap->ops->qc_fill_rtf(qc);
+	if ((qc->flags & ATA_QCFLAG_RTF_VALID) == 0) {
+		qc->result_tf.flags = qc->tf.flags;
+		qc->flags |= ATA_QCFLAG_RTF_VALID;
+		ap->ops->qc_fill_rtf(qc);
+	}
 }
 
 static void ata_verify_xfer(struct ata_queued_cmd *qc)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c1db2f2..b5d753e 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1518,6 +1518,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
 	memcpy(&qc->result_tf, &tf, sizeof(tf));
 	qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
 	qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
+	qc->flags |= ATA_QCFLAG_RTF_VALID;
 	ehc->i.err_mask &= ~AC_ERR_DEV;
 }
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 225bfc5..08fc5a9 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -233,6 +233,7 @@ enum {
 	ATA_QCFLAG_FAILED	= (1 << 16), /* cmd failed and is owned by EH */
 	ATA_QCFLAG_SENSE_VALID	= (1 << 17), /* sense data valid */
 	ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
+	ATA_QCFLAG_RTF_VALID	= (1 << 19), /* set when result_tf is valid */
 
 	/* host set flags */
 	ATA_HOST_SIMPLEX	= (1 << 0),	/* Host is simplex, one DMA channel per host only */
-- 
1.5.4.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-06  1:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06  1:27 [PATH 1/2] [sata_mv] enable FIS Based Switching when a Port Multiplier is connected: [libata] add fields to store TaskFile before error handling kicks Gwendal Grignou
  -- strict thread matches above, loose matches on Subject: below --
2008-10-06  1:11 Gwendal Grignou

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).