diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp index 27c837d8d1..889c657247 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_common.cpp @@ -278,8 +278,11 @@ ps2_interrupt(void* cookie) ps2_dev *dev; ctrl = ps2_read_ctrl(); - if (!(ctrl & PS2_STATUS_OUTPUT_BUFFER_FULL)) + if (!(ctrl & PS2_STATUS_OUTPUT_BUFFER_FULL)) { + TRACE("ps2: ps2_interrupt unhandled, OBF bit unset, ctrl 0x%02x (%s)\n", + ctrl, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb"); return B_UNHANDLED_INTERRUPT; + } if (atomic_get(&sIgnoreInterrupts)) { TRACE("ps2: ps2_interrupt ignoring, ctrl 0x%02x (%s)\n", ctrl, diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp index bfd492bfb3..fd9ce14a78 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp @@ -289,6 +289,24 @@ probe_keyboard(void) // return B_ERROR; // } +// Some controllers set the disble keyboard command bit to "on" after resetting +// the keyboard device. Read #7973 #6313 for more details. +// So check the command byte now and re-enable the keyboard if it is the case. + uint8 cmdbyte = 0; + status = ps2_command(PS2_CTRL_READ_CMD, NULL, 0, &cmdbyte, 1); + + if (status != B_OK) { + INFO("ps2: cannot read CMD byte on kbd probe:0x%#08lx\n", status); + } else + if ((cmdbyte & PS2_BITS_KEYBOARD_DISABLED) == PS2_BITS_KEYBOARD_DISABLED) { + cmdbyte &= ~PS2_BITS_KEYBOARD_DISABLED; + status = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0); + if (status != B_OK) { + INFO("ps2: cannot write 0x%02x to CMD byte on kbd probe:0x%08lx\n", + cmdbyte, status); + } + } + return B_OK; }