aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_highbank.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-07-02 22:54:16 -0400
committerTejun Heo <tj@kernel.org>2013-07-02 22:54:16 -0400
commit5a0a6a4f17a3606289f96356383db695a555bdbd (patch)
tree0f8e206d65ef29bf81a13213af00db56c90af06c /drivers/ata/sata_highbank.c
parent9bbb1b0e2a83c5b3922a050acc932ee3004e85b6 (diff)
parent1cfc7df3de10c40ed459e13cce6de616023bf41c (diff)
Merge branch 'libata/for-3.10-fixes' into libata/for-3.11
libata/for-3.10-fixes never got submitted during v3.10 cycle. Merge it into for-3.11 so that it can be routed together with other changes scheduled for v3.11. Three trivial conflicts in drivers/ata/sata_rcar.c. All are caused by 1b20f6a9ad ("sata_rcar: add 'base' local variable to some functions") conflicting with logic updates in for-3.10-fixes. The offending commit simply adds local variable @base on functions which dereferences sata_rcar_priv->base multiple times. The resolutions are trivial - applying s/priv->base/base/ in the conflicting logic updates. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/sata_highbank.c')
-rw-r--r--drivers/ata/sata_highbank.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 8de8ac80335b..d047d92a456f 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -339,10 +339,26 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
339 return 0; 339 return 0;
340} 340}
341 341
342/*
343 * The Calxeda SATA phy intermittently fails to bring up a link with Gen3
344 * Retrying the phy hard reset can work around the issue, but the drive
345 * may fail again. In less than 150 out of 15000 test runs, it took more
346 * than 10 tries for the link to be established (but never more than 35).
347 * Triple the maximum observed retry count to provide plenty of margin for
348 * rare events and to guarantee that the link is established.
349 *
350 * Also, the default 2 second time-out on a failed drive is too long in
351 * this situation. The uboot implementation of the same driver function
352 * uses a much shorter time-out period and never experiences a time out
353 * issue. Reducing the time-out to 500ms improves the responsiveness.
354 * The other timing constants were kept the same as the stock AHCI driver.
355 * This change was also tested 15000 times on 24 drives and none of them
356 * experienced a time out.
357 */
342static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class, 358static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
343 unsigned long deadline) 359 unsigned long deadline)
344{ 360{
345 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); 361 static const unsigned long timing[] = { 5, 100, 500};
346 struct ata_port *ap = link->ap; 362 struct ata_port *ap = link->ap;
347 struct ahci_port_priv *pp = ap->private_data; 363 struct ahci_port_priv *pp = ap->private_data;
348 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; 364 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
@@ -350,7 +366,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
350 bool online; 366 bool online;
351 u32 sstatus; 367 u32 sstatus;
352 int rc; 368 int rc;
353 int retry = 10; 369 int retry = 100;
354 370
355 ahci_stop_engine(ap); 371 ahci_stop_engine(ap);
356 372