diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-08-28 22:25:41 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-08-28 22:25:41 +0000 |
| commit | de7ac779e942cdcb4f0540a6fd024bcdf44a3bc7 (patch) | |
| tree | 458cf197fce2ce2d30c638a14f90011cdabb7f75 /sys/dev/sio/sio.c | |
| parent | e353d3a1e087ab93debe160a40a69b49aacb55ba (diff) | |
Notes
Diffstat (limited to 'sys/dev/sio/sio.c')
| -rw-r--r-- | sys/dev/sio/sio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index de38f2fdfbca..d98ef8965a8d 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -1233,6 +1233,7 @@ open_top: * XXX we should goto open_top if comparam() slept. */ if (com->hasfifo) { + int i; /* * (Re)enable and drain fifos. * @@ -1244,7 +1245,7 @@ open_top: * and to handle races between enabling and fresh * input. */ - while (TRUE) { + for (i = 0; i < 500; i++) { sio_setreg(com, com_fifo, FIFO_RCV_RST | FIFO_XMT_RST | com->fifo_image); @@ -1266,6 +1267,10 @@ open_top: DELAY(50); (void) inb(com->data_port); } + if (i == 500) { + error = EIO; + goto out; + } } mtx_lock_spin(&sio_lock); |
