From 0881a7be8d7931df81c8b8444c926231ec3355d9 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 11 Feb 2022 18:57:08 +0200 Subject: [PATCH] Kernel: Increase delay and attempts count when checking i8042 existence --- Kernel/Devices/HID/I8042Controller.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/Devices/HID/I8042Controller.cpp b/Kernel/Devices/HID/I8042Controller.cpp index 8b5b0379d1..b6253e3e30 100644 --- a/Kernel/Devices/HID/I8042Controller.cpp +++ b/Kernel/Devices/HID/I8042Controller.cpp @@ -36,14 +36,14 @@ UNMAP_AFTER_INIT bool I8042Controller::check_existence(Badge) { SpinlockLocker lock(m_lock); // Note: Perform controller self-test before touching the controller - // Try to probe the controller for 5 times and give up if nothing + // Try to probe the controller for 10 times and give up if nothing // responded. - for (int attempt = 0; attempt < 5; attempt++) { + for (int attempt = 0; attempt < 10; attempt++) { do_write(I8042Port::Command, I8042Command::TestPS2Controller); if (do_read(I8042Port::Buffer) == I8042Response::ControllerTestPassed) return true; - // Note: Wait 50 microseconds in case the controller couldn't respond - IO::delay(50); + // Note: Wait 500 microseconds in case the controller couldn't respond + IO::delay(500); } dbgln("I8042: Trying to probe for existence of controller failed"); return false;