ata_std_timeout boot monitor variable to override short timeouts on

test transactions and ioctl() setting, in case of comatose drives.
This commit is contained in:
Ben Gras 2005-08-09 12:42:53 +00:00
parent f3500010b7
commit 1d3fb6ea2e

View File

@ -171,6 +171,7 @@ struct command {
/* Timeouts and max retries. */ /* Timeouts and max retries. */
int timeout_ticks = DEF_TIMEOUT_TICKS, max_errors = MAX_ERRORS; int timeout_ticks = DEF_TIMEOUT_TICKS, max_errors = MAX_ERRORS;
int wakeup_ticks = WAKEUP; int wakeup_ticks = WAKEUP;
long w_standard_timeouts = 0;
int w_testing = 0, w_silent = 0; int w_testing = 0, w_silent = 0;
@ -310,6 +311,8 @@ PRIVATE void init_params()
/* Base I/O register to address controller. */ /* Base I/O register to address controller. */
wn->base = drive < 2 ? REG_BASE0 : REG_BASE1; 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_errors = max_errors;
save_wakeup = wakeup_ticks; save_wakeup = wakeup_ticks;
timeout_ticks = HZ * 2; if(!w_standard_timeouts) {
wakeup_ticks = HZ * 5; timeout_ticks = HZ * 2;
max_errors = 2; wakeup_ticks = HZ * 5;
max_errors = 2;
}
w_testing = 1; w_testing = 1;
/* Try I/O on the actual drive (not any (sub)partition). */ /* Try I/O on the actual drive (not any (sub)partition). */
@ -1277,18 +1283,20 @@ message *m;
w_silent = 0; w_silent = 0;
} else if(timeout < 0) { } else if(timeout < 0) {
return EINVAL; return EINVAL;
} else { } else {
prev = wakeup_ticks; prev = wakeup_ticks;
/* Set (lower) timeout, lower error if(!w_standard_timeouts) {
* tolerance and set silent mode. /* Set (lower) timeout, lower error
*/ * tolerance and set silent mode.
wakeup_ticks = timeout; */
max_errors = 2; wakeup_ticks = timeout;
w_silent = 1; max_errors = 2;
w_silent = 1;
if(timeout_ticks > timeout) if(timeout_ticks > timeout)
timeout_ticks = timeout; timeout_ticks = timeout;
}
if((r=sys_datacopy(SELF, (vir_bytes)&prev, if((r=sys_datacopy(SELF, (vir_bytes)&prev,
m->PROC_NR, (vir_bytes)m->ADDRESS, sizeof(prev))) != OK) m->PROC_NR, (vir_bytes)m->ADDRESS, sizeof(prev))) != OK)