[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 <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Jens Axboe and committed by Linus Torvalds 2e11c207 7523c4dd

+7 -1
+7 -1
drivers/cdrom/cdrom.c
··· 337 /* used in the audio ioctls */ 338 #define CHECKAUDIO if ((ret=check_for_audio_disc(cdi, cdo))) return ret 339 340 /* Not-exported routines. */ 341 static int open_for_data(struct cdrom_device_info * cdi); 342 static int check_for_audio_disc(struct cdrom_device_info * cdi, ··· 1534 cgc->buffer = (char *) buf; 1535 cgc->buflen = len; 1536 cgc->data_direction = type; 1537 - cgc->timeout = 5*HZ; 1538 } 1539 1540 /* DVD handling */
··· 337 /* used in the audio ioctls */ 338 #define CHECKAUDIO if ((ret=check_for_audio_disc(cdi, cdo))) return ret 339 340 + /* 341 + * Another popular OS uses 7 seconds as the hard timeout for default 342 + * commands, so it is a good choice for us as well. 343 + */ 344 + #define CDROM_DEF_TIMEOUT (7 * HZ) 345 + 346 /* Not-exported routines. */ 347 static int open_for_data(struct cdrom_device_info * cdi); 348 static int check_for_audio_disc(struct cdrom_device_info * cdi, ··· 1528 cgc->buffer = (char *) buf; 1529 cgc->buflen = len; 1530 cgc->data_direction = type; 1531 + cgc->timeout = CDROM_DEF_TIMEOUT; 1532 } 1533 1534 /* DVD handling */