diff options
| author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2002-09-16 07:14:02 +0000 |
|---|---|---|
| committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2002-09-16 07:14:02 +0000 |
| commit | 14955691c1b9a258de8e286d6c97a2b337e87d7b (patch) | |
| tree | da6d9c9efca1b3d4013e3c7a55b50d40833edc84 | |
| parent | 49e387d30b64d063c2299253d21daf32903b4e6b (diff) | |
Notes
| -rw-r--r-- | sys/pc98/cbus/sio.c | 7 | ||||
| -rw-r--r-- | sys/pc98/pc98/sio.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index e2f6916dd374..ce35e3f5a747 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -1948,6 +1948,7 @@ open_top: * XXX we should goto open_top if comparam() slept. */ if (com->hasfifo) { + int i; /* * (Re)enable and drain fifos. * @@ -1959,7 +1960,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); @@ -1992,6 +1993,10 @@ open_top: DELAY(50); (void) inb(com->data_port); } + if (i == 500) { + error = EIO; + goto out; + } } mtx_lock_spin(&sio_lock); diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index e2f6916dd374..ce35e3f5a747 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -1948,6 +1948,7 @@ open_top: * XXX we should goto open_top if comparam() slept. */ if (com->hasfifo) { + int i; /* * (Re)enable and drain fifos. * @@ -1959,7 +1960,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); @@ -1992,6 +1993,10 @@ open_top: DELAY(50); (void) inb(com->data_port); } + if (i == 500) { + error = EIO; + goto out; + } } mtx_lock_spin(&sio_lock); |
