linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: reduce ATA command timeout to 7secs
@ 2007-02-02  6:37 Tejun Heo
  2007-02-02 10:08 ` Alan
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Tejun Heo @ 2007-02-02  6:37 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide, Alan Cox

Both ATA and ATAPI devices used the default timeouts defined by SCSI
high level driver.  For both disks and ODDs, it was 30secs, which was
way too long for disks.  This patch makes most ATA commands time out
after 7secs - the de facto ATA command timeout, while leaving ATAPI
timeout at 30secs.

Note that both normal commands and EH commands timeouts are adjusted
to 7 secs, but cache flushses still have 30sec timeout.  This is a
side effect of the way sd makes use of sdev->timeout, but this is a
good side effect in that ATA spec requires cache flushes are given
longer timeout.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
I think we've waited enough.  Combined with EH updates which will soon
be posted, this should make life much easier (well, at least
responsive) when something goes wrong with ATA.

 drivers/ata/libata-core.c |    2 +-
 drivers/ata/libata-scsi.c |    6 ++++++
 include/linux/libata.h    |    4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 582e44d..a441c75 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -89,7 +89,7 @@ int libata_fua = 0;
 module_param_named(fua, libata_fua, int, 0444);
 MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
 
-static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
+static int ata_probe_timeout = ATA_TMOUT_CMD / HZ;
 module_param(ata_probe_timeout, int, 0444);
 MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
 
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0009818..dc2157c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -903,6 +903,12 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
 		depth = min(ATA_MAX_QUEUE - 1, depth);
 		scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth);
 	}
+
+	/* setup command timeout */
+	if (dev->class == ATA_DEV_ATA)
+		sdev->timeout = ATA_TMOUT_CMD;
+	else
+		sdev->timeout = ATAPI_TMOUT_CMD;
 }
 
 /**
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 305e95f..4c3ed59 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -214,8 +214,8 @@ enum {
 	/* various lengths of time */
 	ATA_TMOUT_BOOT		= 30 * HZ,	/* heuristic */
 	ATA_TMOUT_BOOT_QUICK	= 7 * HZ,	/* heuristic */
-	ATA_TMOUT_INTERNAL	= 30 * HZ,
-	ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
+	ATA_TMOUT_CMD		= 7 * HZ,	/* de facto ATA cmd timeout */
+	ATAPI_TMOUT_CMD		= 30 * HZ,
 
 	/* ATA bus states */
 	BUS_UNKNOWN		= 0,
-- 
1.4.4.4


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

end of thread, other threads:[~2007-02-03 23:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-02  6:37 [PATCH] libata: reduce ATA command timeout to 7secs Tejun Heo
2007-02-02 10:08 ` Alan
2007-02-02 11:49   ` Tejun Heo
2007-02-02 13:25 ` Ric Wheeler
2007-02-02 15:12   ` Tejun Heo
2007-02-02 15:39     ` Alan
2007-02-02 16:13       ` Mark Lord
2007-02-02 16:43         ` Eric D. Mudama
2007-02-02 18:47           ` Alan
2007-02-02 23:00             ` Eric D. Mudama
2007-02-03 23:34             ` Ric Wheeler
2007-02-03  4:31       ` Tejun Heo
2007-02-03 19:59         ` Alan
2007-02-03 19:50           ` Mark Lord
2007-02-02 16:12 ` Mark Lord
2007-02-03  4:45   ` Tejun Heo

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