summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2002-09-16 07:14:02 +0000
committernyan <nyan@FreeBSD.org>2002-09-16 07:14:02 +0000
commitcb30d5a6d98bfe18ff463e314304341d05395b9b (patch)
treeda6d9c9efca1b3d4013e3c7a55b50d40833edc84 /sys
parent879fee156b55352456a94abb21bf96d65e23098f (diff)
downloadFreeBSD-src-cb30d5a6d98bfe18ff463e314304341d05395b9b.zip
FreeBSD-src-cb30d5a6d98bfe18ff463e314304341d05395b9b.tar.gz
Merged from sys/dev/sio/sio.c revision 1.378.
Diffstat (limited to 'sys')
-rw-r--r--sys/pc98/cbus/sio.c7
-rw-r--r--sys/pc98/pc98/sio.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index e2f6916..ce35e3f 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 e2f6916..ce35e3f 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);
OpenPOWER on IntegriCloud