Patchwork [U-Boot,v3,09/22] ahci: Make sending the SETFEATURES_XFER command optional

login
register
mail settings
Submitter Simon Glass
Date Oct. 29, 2012, 3:23 p.m.
Message ID <1351524245-19584-10-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/195049/
State Accepted, archived
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - Oct. 29, 2012, 3:23 p.m.
From: Gabe Black <gabeblack@chromium.org>

This command doesn't really do anything when talking to a SATA device, and
sending it confuses some of them. This change makes sending the command
optional, and defaults to not. The situations where it should be sent are not
the common case.

With the standard SSD in the machine, here are some times with the option
turned off:
1. 8277
2. 8273
3. 8050

And turned on:
1. 8303
2. 8155
3. 8276

Sending that command seems to have no meaningful effect on performance.

This fixes problems with an SSD marked Toshiba NV6424, Taiwan 11159AE P
and TC58NVG5D2FTA10.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Taylor Hutt <thutt@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- Move missing #ifdef CONFIG_AHCI_SETFEATURES_XFER from later commit

 drivers/block/ahci.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 0a7ad81..2236321 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -373,6 +373,7 @@  static void ahci_fill_cmd_slot(struct ahci_ioports *pp, u32 opts)
 }
 
 
+#ifdef CONFIG_AHCI_SETFEATURES_XFER
 static void ahci_set_feature(u8 port)
 {
 	struct ahci_ioports *pp = &(probe_ent->port[port]);
@@ -397,6 +398,7 @@  static void ahci_set_feature(u8 port)
 		printf("set feature error on port %d!\n", port);
 	}
 }
+#endif
 
 
 static int ahci_port_start(u8 port)
@@ -743,7 +745,9 @@  void scsi_low_level_init(int busdevfunc)
 				printf("Can not start port %d\n", i);
 				continue;
 			}
+#ifdef CONFIG_AHCI_SETFEATURES_XFER
 			ahci_set_feature((u8) i);
+#endif
 		}
 	}
 }
@@ -784,7 +788,9 @@  int ahci_init(u32 base)
 				printf("Can not start port %d\n", i);
 				continue;
 			}
+#ifdef CONFIG_AHCI_SETFEATURES_XFER
 			ahci_set_feature((u8) i);
+#endif
 		}
 	}
 err_out: