summaryrefslogtreecommitdiff
path: root/Kernel/Devices/HID
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-03-19 11:31:32 +0200
committerLinus Groh <mail@linusgroh.de>2022-03-19 15:37:03 +0000
commit7ff6d4d72b9b80b034b31062c1b329fbfefca3f8 (patch)
tree74605c589ae863504d9540a3ea4f085238b80291 /Kernel/Devices/HID
parentcbd343dcedfb061bc5c3c01c3caae78010cee219 (diff)
downloadserenity-7ff6d4d72b9b80b034b31062c1b329fbfefca3f8.zip
Kernel: Increase i8042 timeout when writing and reading from device
This proved to be crucial on my ICH7 test machine because it takes a bit more time to do IO on its i8042 controller.
Diffstat (limited to 'Kernel/Devices/HID')
-rw-r--r--Kernel/Devices/HID/I8042Controller.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Devices/HID/I8042Controller.cpp b/Kernel/Devices/HID/I8042Controller.cpp
index cb96e364d9..ad69b8dc7e 100644
--- a/Kernel/Devices/HID/I8042Controller.cpp
+++ b/Kernel/Devices/HID/I8042Controller.cpp
@@ -292,8 +292,8 @@ ErrorOr<u8> I8042Controller::do_write_to_device(HIDDevice::Type device, u8 data)
IO::out8(I8042Port::Buffer, data);
response = TRY(do_wait_then_read(I8042Port::Buffer));
- } while (response == I8042Response::Resend && ++attempts < 3);
- if (attempts >= 3)
+ } while (response == I8042Response::Resend && ++attempts < 250);
+ if (attempts >= 250)
dbgln("Failed to write byte to device, gave up");
return response;
}
@@ -310,7 +310,7 @@ ErrorOr<void> I8042Controller::prepare_for_input(HIDDevice::Type device)
{
VERIFY(m_lock.is_locked());
u8 const second_port_flag = device == HIDDevice::Type::Keyboard ? 0 : I8042StatusFlag::SecondPS2PortOutputBuffer;
- for (int attempt = 0; attempt < 250; attempt++) {
+ for (int attempt = 0; attempt < 1000; attempt++) {
u8 status = IO::in8(I8042Port::Status);
if (!(status & I8042StatusFlag::OutputBuffer)) {
IO::delay(1000);