diff options
author | alfred <alfred@FreeBSD.org> | 2001-03-27 05:03:49 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-03-27 05:03:49 +0000 |
commit | 7c1edc42aa80889aeac1b223afc1b13d4ba8a2ff (patch) | |
tree | 4c9182a57d5ced315d53895ac45f0370af04307c | |
parent | bf4ebb714193c5f2005f1ea3e20f3487496ca75c (diff) | |
download | FreeBSD-src-7c1edc42aa80889aeac1b223afc1b13d4ba8a2ff.zip FreeBSD-src-7c1edc42aa80889aeac1b223afc1b13d4ba8a2ff.tar.gz |
limit the amount of retries when sending data to prevent lockups.
-rw-r--r-- | sys/dev/wi/if_wi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index de2de2a..9e27254 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -952,8 +952,10 @@ static int wi_write_data(sc, id, off, buf, len) { int i; u_int16_t *ptr; - #ifdef WI_HERMES_AUTOINC_WAR + int retries; + + retries = WI_TIMEOUT >> 4; again: #endif @@ -973,7 +975,12 @@ again: if (CSR_READ_2(sc, WI_DATA0) != 0x1234 || CSR_READ_2(sc, WI_DATA0) != 0x5678) - goto again; + { + if (--retries >= 0) + goto again; + device_printf(sc->dev, "wi_write_data device timeout\n"); + return (EIO); + } #endif return(0); |