summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc
diff options
context:
space:
mode:
authordwhite <dwhite@FreeBSD.org>2006-09-04 00:19:31 +0000
committerdwhite <dwhite@FreeBSD.org>2006-09-04 00:19:31 +0000
commit3631541670c84a8731b46350daa30502edb0ca80 (patch)
tree72b8991c8e29ac2911e0e78318e998df43e7cf14 /sys/dev/atkbdc
parent9fce925349f1fee8f770e53ac87edc3578835bf5 (diff)
downloadFreeBSD-src-3631541670c84a8731b46350daa30502edb0ca80.zip
FreeBSD-src-3631541670c84a8731b46350daa30502edb0ca80.tar.gz
Avoid an infinite loop in empty_both_buffers() by adding a timeout.
This helps systems that don't actually have atkbd controllers, such as the Intel SBX82 blade, boot without device.hints hacks. Hardware for this fix provided by iXsystems. PR: 94822 Submitted by: Devon H. O'Dell <devon.odell@coyotepoint.com> MFC After: 3 days
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r--sys/dev/atkbdc/atkbdc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/atkbdc.c b/sys/dev/atkbdc/atkbdc.c
index 248ac2f..df1f28e 100644
--- a/sys/dev/atkbdc/atkbdc.c
+++ b/sys/dev/atkbdc/atkbdc.c
@@ -857,6 +857,7 @@ empty_both_buffers(KBDC p, int wait)
{
int t;
int f;
+ int waited = 0;
#if KBDIO_DEBUG >= 2
int c1 = 0;
int c2 = 0;
@@ -877,6 +878,16 @@ empty_both_buffers(KBDC p, int wait)
} else {
t -= delta;
}
+
+ /*
+ * Some systems (Intel/IBM blades) do not have keyboard devices and
+ * will thus hang in this procedure. Time out after delta seconds to
+ * avoid this hang -- the keyboard attach will fail later on.
+ */
+ waited += (delta * 1000);
+ if (waited == (delta * 1000000))
+ return;
+
DELAY(delta*1000);
}
#if KBDIO_DEBUG >= 2
OpenPOWER on IntegriCloud