From: Ben Gras Date: Tue, 9 Aug 2005 12:42:53 +0000 (+0000) Subject: ata_std_timeout boot monitor variable to override short timeouts on X-Git-Tag: v3.1.0~391 X-Git-Url: http://zhaoyanbai.com/repos/doc/html/static/gitweb.css?a=commitdiff_plain;h=1d3fb6ea2ef562486c30c39846d04668df8729f9;p=minix.git ata_std_timeout boot monitor variable to override short timeouts on test transactions and ioctl() setting, in case of comatose drives. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index f9e35bcec..30580eae6 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -171,6 +171,7 @@ struct command { /* Timeouts and max retries. */ int timeout_ticks = DEF_TIMEOUT_TICKS, max_errors = MAX_ERRORS; int wakeup_ticks = WAKEUP; +long w_standard_timeouts = 0; int w_testing = 0, w_silent = 0; @@ -310,6 +311,8 @@ PRIVATE void init_params() /* Base I/O register to address controller. */ wn->base = drive < 2 ? REG_BASE0 : REG_BASE1; } + + env_parse("ata_std_timeout", "d", 0, &w_standard_timeouts, 0, 1); } @@ -566,9 +569,12 @@ PRIVATE int w_io_test(void) save_errors = max_errors; save_wakeup = wakeup_ticks; - timeout_ticks = HZ * 2; - wakeup_ticks = HZ * 5; - max_errors = 2; + if(!w_standard_timeouts) { + timeout_ticks = HZ * 2; + wakeup_ticks = HZ * 5; + max_errors = 2; + } + w_testing = 1; /* Try I/O on the actual drive (not any (sub)partition). */ @@ -1277,18 +1283,20 @@ message *m; w_silent = 0; } else if(timeout < 0) { return EINVAL; - } else { + } else { prev = wakeup_ticks; - /* Set (lower) timeout, lower error - * tolerance and set silent mode. - */ - wakeup_ticks = timeout; - max_errors = 2; - w_silent = 1; + if(!w_standard_timeouts) { + /* Set (lower) timeout, lower error + * tolerance and set silent mode. + */ + wakeup_ticks = timeout; + max_errors = 2; + w_silent = 1; - if(timeout_ticks > timeout) - timeout_ticks = timeout; + if(timeout_ticks > timeout) + timeout_ticks = timeout; + } if((r=sys_datacopy(SELF, (vir_bytes)&prev, m->PROC_NR, (vir_bytes)m->ADDRESS, sizeof(prev))) != OK)