Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e11c207b029cfaf57159cabac4b002204445258
Commit:     2e11c207b029cfaf57159cabac4b002204445258
Parent:     7523c4dd9923cab748dad9b79d0165e118e3d03b
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 3 08:10:35 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Jan 3 17:32:54 2007 -0800

    [PATCH] cdrom: set default timeout to 7 seconds
    
    It's a known fact that Windows times out commands after 7 seconds, so
    drives generally try and respond if they can before that happens.  We
    default to 5 seconds, which sometimes is a bit too short.
    
    Jeremy Higdon reported here:
    
        http://lkml.org/lkml/2007/1/1/145
    
    that his drive takes longer than 5 seconds for a "read track
    information" command, later confirming that it is about 6.7 seconds.
    
    So just do the sane thing and change the default command timeout to 7
    seconds to avoid other surprises.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/cdrom/cdrom.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 66d028d..3105ddd 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -337,6 +337,12 @@ static const char *mrw_address_space[] = { "DMA", "GAA" };
 /* used in the audio ioctls */
 #define CHECKAUDIO if ((ret=check_for_audio_disc(cdi, cdo))) return ret
 
+/*
+ * Another popular OS uses 7 seconds as the hard timeout for default
+ * commands, so it is a good choice for us as well.
+ */
+#define CDROM_DEF_TIMEOUT      (7 * HZ)
+
 /* Not-exported routines. */
 static int open_for_data(struct cdrom_device_info * cdi);
 static int check_for_audio_disc(struct cdrom_device_info * cdi,
@@ -1528,7 +1534,7 @@ void init_cdrom_command(struct packet_command *cgc, void 
*buf, int len,
        cgc->buffer = (char *) buf;
        cgc->buflen = len;
        cgc->data_direction = type;
-       cgc->timeout = 5*HZ;
+       cgc->timeout = CDROM_DEF_TIMEOUT;
 }
 
 /* DVD handling */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to