Suppress the keyboard and AUX interrupts during sending

PS/2 active multiplexing activation sequence. This prevent from
IRQ storm on some controllers. Fixes #7635.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42323 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski
2011-06-26 18:04:29 +00:00
parent 9186e23d5a
commit 6b61d62e98
@@ -125,7 +125,7 @@ ps2_selftest()
static status_t
ps2_setup_command_byte()
ps2_setup_command_byte(bool interruptsEnabled)
{
status_t res;
uint8 cmdbyte;
@@ -135,10 +135,14 @@ ps2_setup_command_byte()
if (res != B_OK)
cmdbyte = 0x47;
cmdbyte |= PS2_BITS_TRANSLATE_SCANCODES | PS2_BITS_KEYBOARD_INTERRUPT
| PS2_BITS_AUX_INTERRUPT;
cmdbyte |= PS2_BITS_TRANSLATE_SCANCODES;
cmdbyte &= ~(PS2_BITS_KEYBOARD_DISABLED | PS2_BITS_MOUSE_DISABLED);
if (interruptsEnabled)
cmdbyte |= PS2_BITS_KEYBOARD_INTERRUPT | PS2_BITS_AUX_INTERRUPT;
else
cmdbyte &= ~(PS2_BITS_KEYBOARD_INTERRUPT | PS2_BITS_AUX_INTERRUPT);
res = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0);
TRACE("ps2: set command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte);
@@ -357,9 +361,12 @@ ps2_init(void)
// after that
//ps2_selftest();
status = ps2_setup_command_byte();
// Setup the command byte with disabled keyboard and AUX interrupts
// to prevent interrupts storm on some KBCs during active multiplexing
// activation procedure. Fixes #7635.
status = ps2_setup_command_byte(false);
if (status) {
INFO("ps2: setting up command byte failed\n");
INFO("ps2: initial setup of command byte failed\n");
goto err5;
}
@@ -370,6 +377,12 @@ ps2_init(void)
goto err5;
}
status = ps2_setup_command_byte(true);
if (status) {
INFO("ps2: setting up command byte with enabled interrupts failed\n");
goto err5;
}
if (gActiveMultiplexingEnabled) {
if (ps2_dev_command_timeout(&ps2_device[PS2_DEVICE_MOUSE], 0xe6,
NULL, 0, NULL, 0, 100000) == B_TIMED_OUT) {