summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-06-29 09:29:43 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-07-02 07:33:38 +0000
commit6756c16e82728ce612a333017bf23f5a497f554f (patch)
tree92a54ed52b1e03165aaa19c449e751a8f4fa71a5
parent1299dc107dca75a586f05ebdeaf99ba6a974a5e7 (diff)
downloadcoreboot-6756c16e82728ce612a333017bf23f5a497f554f.tar.xz
payloads/libpayload/drivers/i8042: Disable scanning on disconnect
This change ensures that keyboard scanning is disabled and keyboard is set to default state while disconnecting the keyboard. This is required to ensure that the controller doesn't keep scanning and buffering keystrokes which could lead to OS drivers reading stale data. BUG=b:110024487 TEST=Verified that kernel driver is able to probe correctly even if multiple keys are pressed during handoff from payload to OS. Change-Id: I1ffb8904d545284454c1825ee2e7c0087fc13762 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/27290 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--payloads/libpayload/drivers/i8042/keyboard.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/i8042/keyboard.c b/payloads/libpayload/drivers/i8042/keyboard.c
index d5606a3893..062aec2bf0 100644
--- a/payloads/libpayload/drivers/i8042/keyboard.c
+++ b/payloads/libpayload/drivers/i8042/keyboard.c
@@ -338,6 +338,9 @@ void keyboard_disconnect(void)
while (keyboard_havechar())
keyboard_getchar();
+ /* Disable scanning */
+ keyboard_cmd(I8042_KBCMD_DEFAULT_DIS);
+
/* Send keyboard disconnect command */
i8042_cmd(I8042_CMD_DIS_KB);