Prevent atkbd(4) interrupt handler from calling keyboard callback function

when polled mode is enabled. This should help with duplicated/missing
characters problem at mountroot, geli, etc. prompts on multi CPU systems
while kbdmux(4) is enabled.

Tested by:	Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de>
Tested by:	Fabian Keil <freebsd-listen -at- fabiankeil -dot- de>
MFC after:	3 days
This commit is contained in:
Maksim Yevmenkin 2009-04-17 00:30:56 +00:00
parent a0c4317cc2
commit 018cd707c0

View File

@ -476,7 +476,7 @@ atkbd_term(keyboard_t *kbd)
static int
atkbd_intr(keyboard_t *kbd, void *arg)
{
atkbd_state_t *state;
atkbd_state_t *state = (atkbd_state_t *)kbd->kb_data;
int delay[2];
int c;
@ -485,7 +485,6 @@ atkbd_intr(keyboard_t *kbd, void *arg)
* The keyboard was not detected before;
* it must have been reconnected!
*/
state = (atkbd_state_t *)kbd->kb_data;
init_keyboard(state->kbdc, &kbd->kb_type,
kbd->kb_config);
KBD_FOUND_DEVICE(kbd);
@ -496,6 +495,9 @@ atkbd_intr(keyboard_t *kbd, void *arg)
atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay);
}
if (state->ks_polling)
return 0;
if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
/* let the callback function to process the input */
(*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,