linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] add DMA setup FIS auto-activate feature
@ 2009-07-23  3:45 Shaohua Li
  2009-07-23  3:50 ` Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Shaohua Li @ 2009-07-23  3:45 UTC (permalink / raw)
  To: linux-ide; +Cc: Jeff Garzik, tj

hi,
The SATA spec defines DMA setup FIS auto-activate optimization for FPDMA
transfers. I had an attempt to add it, though my test doesn't show obvious
performance improvement (not worse too), I wonder why not add this feature?

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2c6aeda..53cc355 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2303,6 +2303,7 @@ static void ata_dev_config_ncq(struct ata_device *dev,
 {
 	struct ata_port *ap = dev->link->ap;
 	int hdepth = 0, ddepth = ata_id_queue_depth(dev->id);
+	const u16 *id = dev->id;
 
 	if (!ata_id_has_ncq(dev->id)) {
 		desc[0] = '\0';
@@ -2317,6 +2318,9 @@ static void ata_dev_config_ncq(struct ata_device *dev,
 		dev->flags |= ATA_DFLAG_NCQ;
 	}
 
+	if (ata_id_has_daa(id))
+		ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, SATA_DAA);
+
 	if (hdepth >= ddepth)
 		snprintf(desc, desc_sz, "NCQ (depth %d)", ddepth);
 	else
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 9c75921..bb5b6ba 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -306,6 +306,7 @@ enum {
 	/* SETFEATURE Sector counts for SATA features */
 	SATA_AN			= 0x05,  /* Asynchronous Notification */
 	SATA_DIPM		= 0x03,  /* Device Initiated Power Management */
+	SATA_DAA		= 0x02,  /* DMA Setup FIS Auto-Activate */
 
 	/* feature values for SET_MAX */
 	ATA_SET_MAX_ADDR	= 0x00,
@@ -525,6 +526,9 @@ static inline int ata_is_data(u8 prot)
 #define ata_id_has_atapi_AN(id)	\
 	( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
 	  ((id)[78] & (1 << 5)) )
+#define ata_id_has_daa(id)	\
+	( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
+	  ((id)[78] & (1 << 2)) )
 #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
 #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
 #define ata_id_u32(id,n)	\



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

end of thread, other threads:[~2009-07-29  1:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23  3:45 [RFC] add DMA setup FIS auto-activate feature Shaohua Li
2009-07-23  3:50 ` Tejun Heo
2009-07-23  3:59 ` Jeff Garzik
2009-07-23  5:40   ` Shaohua Li
2009-07-23  5:45     ` Tejun Heo
2009-07-23  6:07       ` Jeff Garzik
2009-07-23  6:12         ` Tejun Heo
2009-07-23  6:48           ` Jeff Garzik
2009-07-23  7:25             ` Shaohua Li
2009-07-23 18:07               ` Robert Hancock
2009-07-23 18:11                 ` Jeff Garzik
2009-07-23 20:52                   ` Tejun Heo
2009-07-24  9:12                     ` Shaohua Li
2009-07-25  0:47                       ` Tejun Heo
2009-07-27  1:24                         ` Shaohua Li
2009-07-27  1:31                           ` Tejun Heo
2009-07-29  1:20                           ` Jeff Garzik
2009-07-23  6:18       ` Robert Hancock
2009-07-23  9:55 ` Sergei Shtylyov

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