From ff4afe17beee74d9130b5eae6fe407559fc5c90b Mon Sep 17 00:00:00 2001 From: Jesse Buhagiar Date: Sun, 3 Jan 2021 16:01:52 +1100 Subject: [PATCH] Kernel/USB: Ignore shared IRQs According the USB spec/UHCI datasheet (as well as the Linux and BSD source code), if we receive an IRQ and USBSTS is 0, then the IRQ does not belong to us and we should immediately jump out of the handler. --- Kernel/Devices/USB/UHCIController.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Kernel/Devices/USB/UHCIController.cpp b/Kernel/Devices/USB/UHCIController.cpp index 0d82f7e702..dd6a95ab6c 100644 --- a/Kernel/Devices/USB/UHCIController.cpp +++ b/Kernel/Devices/USB/UHCIController.cpp @@ -395,6 +395,10 @@ void UHCIController::spawn_port_proc() void UHCIController::handle_irq(const RegisterState&) { + // Shared IRQ. Not ours! + if(!read_usbsts()) + return; + klog() << "UHCI: Interrupt happened!"; klog() << "Value of USBSTS: " << read_usbsts(); }