aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-core.c18
-rw-r--r--include/linux/libata.h11
2 files changed, 18 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 49cffb6094a3..134b5df80ace 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3631,9 +3631,15 @@ int ata_wait_ready(struct ata_link *link, unsigned long deadline,
3631 int (*check_ready)(struct ata_link *link)) 3631 int (*check_ready)(struct ata_link *link))
3632{ 3632{
3633 unsigned long start = jiffies; 3633 unsigned long start = jiffies;
3634 unsigned long nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT); 3634 unsigned long nodev_deadline;
3635 int warned = 0; 3635 int warned = 0;
3636 3636
3637 /* choose which 0xff timeout to use, read comment in libata.h */
3638 if (link->ap->host->flags & ATA_HOST_PARALLEL_SCAN)
3639 nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT_LONG);
3640 else
3641 nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT);
3642
3637 /* Slave readiness can't be tested separately from master. On 3643 /* Slave readiness can't be tested separately from master. On
3638 * M/S emulation configuration, this function should be called 3644 * M/S emulation configuration, this function should be called
3639 * only on the master and it will handle both master and slave. 3645 * only on the master and it will handle both master and slave.
@@ -3651,12 +3657,12 @@ int ata_wait_ready(struct ata_link *link, unsigned long deadline,
3651 if (ready > 0) 3657 if (ready > 0)
3652 return 0; 3658 return 0;
3653 3659
3654 /* -ENODEV could be transient. Ignore -ENODEV if link 3660 /*
3661 * -ENODEV could be transient. Ignore -ENODEV if link
3655 * is online. Also, some SATA devices take a long 3662 * is online. Also, some SATA devices take a long
3656 * time to clear 0xff after reset. For example, 3663 * time to clear 0xff after reset. Wait for
3657 * HHD424020F7SV00 iVDR needs >= 800ms while Quantum 3664 * ATA_TMOUT_FF_WAIT[_LONG] on -ENODEV if link isn't
3658 * GoVault needs even more than that. Wait for 3665 * offline.
3659 * ATA_TMOUT_FF_WAIT on -ENODEV if link isn't offline.
3660 * 3666 *
3661 * Note that some PATA controllers (pata_ali) explode 3667 * Note that some PATA controllers (pata_ali) explode
3662 * if status register is read more than once when 3668 * if status register is read more than once when
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4fa748e9bc01..242eb2646101 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -256,12 +256,13 @@ enum {
256 ATA_TMOUT_INTERNAL_QUICK = 5000, 256 ATA_TMOUT_INTERNAL_QUICK = 5000,
257 ATA_TMOUT_MAX_PARK = 30000, 257 ATA_TMOUT_MAX_PARK = 30000,
258 258
259 /* FIXME: GoVault needs 2s but we can't afford that without 259 /*
260 * parallel probing. 800ms is enough for iVDR disk 260 * GoVault needs 2s and iVDR disk HHD424020F7SV00 800ms. 2s
261 * HHD424020F7SV00. Increase to 2secs when parallel probing 261 * is too much without parallel probing. Use 2s if parallel
262 * is in place. 262 * probing is available, 800ms otherwise.
263 */ 263 */
264 ATA_TMOUT_FF_WAIT = 800, 264 ATA_TMOUT_FF_WAIT_LONG = 2000,
265 ATA_TMOUT_FF_WAIT = 800,
265 266
266 /* Spec mandates to wait for ">= 2ms" before checking status 267 /* Spec mandates to wait for ">= 2ms" before checking status
267 * after reset. We wait 150ms, because that was the magic 268 * after reset. We wait 150ms, because that was the magic