mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
This commit is contained in:
parent
e1cb7bc081
commit
9aeef36608
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue