* [PATCH #upstream] libata: use longer 0xff wait if parallel scan is enabled
@ 2010-04-09 10:46 Tejun Heo
2010-04-23 2:05 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2010-04-09 10:46 UTC (permalink / raw)
To: Jeff Garzik, linux-ide@vger.kernel.org; +Cc: garyhade
There are some SATA devices which take relatively long to get out of
0xff status after reset. In libata, this timeout is determined by
ATA_TMOUT_FF_WAIT. Quantum GoVault is the worst requring about 2s for
reliable detection. However, because 2s 0xff timeout can introduce
rather long spurious delay during boot, libata has been compromising
at the next longest timeout of 800ms for HHD424020F7SV00 iVDR drive.
Now that parallel scan is in place for common drivers, libata can
afford 2s 0xff timeout. Use 2s 0xff timeout if parallel scan is
enabled.
Please note that the chance of spurious wait is pretty slim w/ working
SCR access so this will only affect SATA controllers w/o SCR access
which isn't too common these days.
Please read the following thread for more information on the GoVault
drive.
http://thread.gmane.org/gmane.linux.ide/14545/focus=14663
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Gary Hade <garyhade@us.ibm.com>
---
drivers/ata/libata-core.c | 18 ++++++++++++------
include/linux/libata.h | 11 ++++++-----
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 49cffb6..134b5df 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,
int (*check_ready)(struct ata_link *link))
{
unsigned long start = jiffies;
- unsigned long nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT);
+ unsigned long nodev_deadline;
int warned = 0;
+ /* choose which 0xff timeout to use, read comment in libata.h */
+ if (link->ap->host->flags & ATA_HOST_PARALLEL_SCAN)
+ nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT_LONG);
+ else
+ nodev_deadline = ata_deadline(start, ATA_TMOUT_FF_WAIT);
+
/* Slave readiness can't be tested separately from master. On
* M/S emulation configuration, this function should be called
* 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,
if (ready > 0)
return 0;
- /* -ENODEV could be transient. Ignore -ENODEV if link
+ /*
+ * -ENODEV could be transient. Ignore -ENODEV if link
* is online. Also, some SATA devices take a long
- * time to clear 0xff after reset. For example,
- * HHD424020F7SV00 iVDR needs >= 800ms while Quantum
- * GoVault needs even more than that. Wait for
- * ATA_TMOUT_FF_WAIT on -ENODEV if link isn't offline.
+ * time to clear 0xff after reset. Wait for
+ * ATA_TMOUT_FF_WAIT[_LONG] on -ENODEV if link isn't
+ * offline.
*
* Note that some PATA controllers (pata_ali) explode
* if status register is read more than once when
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b2f2003..06b689b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -256,12 +256,13 @@ enum {
ATA_TMOUT_INTERNAL_QUICK = 5000,
ATA_TMOUT_MAX_PARK = 30000,
- /* FIXME: GoVault needs 2s but we can't afford that without
- * parallel probing. 800ms is enough for iVDR disk
- * HHD424020F7SV00. Increase to 2secs when parallel probing
- * is in place.
+ /*
+ * GoVault needs 2s and iVDR disk HHD424020F7SV00 800ms. 2s
+ * is too much without parallel probing. Use 2s if parallel
+ * probing is available, 800ms otherwise.
*/
- ATA_TMOUT_FF_WAIT = 800,
+ ATA_TMOUT_FF_WAIT_LONG = 2000,
+ ATA_TMOUT_FF_WAIT = 800,
/* Spec mandates to wait for ">= 2ms" before checking status
* after reset. We wait 150ms, because that was the magic
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH #upstream] libata: use longer 0xff wait if parallel scan is enabled
2010-04-09 10:46 [PATCH #upstream] libata: use longer 0xff wait if parallel scan is enabled Tejun Heo
@ 2010-04-23 2:05 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2010-04-23 2:05 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide@vger.kernel.org, garyhade
On 04/09/2010 06:46 AM, Tejun Heo wrote:
> There are some SATA devices which take relatively long to get out of
> 0xff status after reset. In libata, this timeout is determined by
> ATA_TMOUT_FF_WAIT. Quantum GoVault is the worst requring about 2s for
> reliable detection. However, because 2s 0xff timeout can introduce
> rather long spurious delay during boot, libata has been compromising
> at the next longest timeout of 800ms for HHD424020F7SV00 iVDR drive.
>
> Now that parallel scan is in place for common drivers, libata can
> afford 2s 0xff timeout. Use 2s 0xff timeout if parallel scan is
> enabled.
>
> Please note that the chance of spurious wait is pretty slim w/ working
> SCR access so this will only affect SATA controllers w/o SCR access
> which isn't too common these days.
>
> Please read the following thread for more information on the GoVault
> drive.
>
> http://thread.gmane.org/gmane.linux.ide/14545/focus=14663
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Cc: Gary Hade<garyhade@us.ibm.com>
> ---
> drivers/ata/libata-core.c | 18 ++++++++++++------
> include/linux/libata.h | 11 ++++++-----
> 2 files changed, 18 insertions(+), 11 deletions(-)
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-23 2:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 10:46 [PATCH #upstream] libata: use longer 0xff wait if parallel scan is enabled Tejun Heo
2010-04-23 2:05 ` Jeff Garzik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.