From 59917ebcdbaf1e861f2db979085f155a2f191556 Mon Sep 17 00:00:00 2001 From: Stoica Tedy Date: Thu, 29 Aug 2019 07:25:51 +0300 Subject: [PATCH] i8042: Reset the keyboard after resuming In some laptops, the keyboard would not reset after resume, thus not working at all. After adding a delay and resetting the device connected to the KBD port, the keyboard works like normal. Fixes: 9d659ae ("locking/mutex: Add lock handoff to avoid starvation") Signed-off-by: Stoica Tedy --- drivers/input/serio/i8042.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index b695094290ab..f024717ff2a1 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -1194,6 +1194,15 @@ static int i8042_controller_resume(bool s2r_wants_reset) if (i8042_ports[I8042_KBD_PORT_NO].serio) i8042_enable_kbd_port(); +/* + * Try and reset the keyboard by writing to it + */ + + if (i8042_kbdreset) { + msleep(50); + pr_warn("Attempting to reset device connected to KBD port\n"); + i8042_kbd_write(NULL, (unsigned char) 0xff); + } i8042_interrupt(0, NULL); return 0; -- 2.23.0.rc1