summaryrefslogtreecommitdiff
path: root/Kernel/Devices/USB
diff options
context:
space:
mode:
authorJesse Buhagiar <jooster669@gmail.com>2021-01-03 16:01:52 +1100
committerAndreas Kling <kling@serenityos.org>2021-01-09 13:48:15 +0100
commitff4afe17beee74d9130b5eae6fe407559fc5c90b (patch)
treead2575d8c4814d44de2387a88de9161ded7bb727 /Kernel/Devices/USB
parent770a729e597702c0a32855b73dfc11fd8469316e (diff)
downloadserenity-ff4afe17beee74d9130b5eae6fe407559fc5c90b.zip
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.
Diffstat (limited to 'Kernel/Devices/USB')
-rw-r--r--Kernel/Devices/USB/UHCIController.cpp4
1 files changed, 4 insertions, 0 deletions
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();
}