From 79ded8ca160af121956dee4a0e2a996b4d082156 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 4 Feb 2020 20:02:05 +0100 Subject: [PATCH] Reduce polling interval for low-speed devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #7651, my Logitech gamepad works. Change-Id: Ia3f92ba817576946dabee262a2fd5af8102a109f Reviewed-on: https://review.haiku-os.org/c/haiku/+/2198 Reviewed-by: Stephan Aßmus --- src/add-ons/kernel/busses/usb/ehci.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index f1164e0245..8c2a08fc86 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -2221,11 +2221,16 @@ EHCI::LinkInterruptQueueHead(ehci_qh *queueHead, Pipe *pipe) queueHead->endpoint_caps |= (0xff << EHCI_QH_CAPS_ISM_SHIFT); } else { // As we do not yet support FSTNs to correctly reference low/full - // speed interrupt transfers, we simply put them into the 1 interval + // speed interrupt transfers, we simply put them into the 1 or 8 interval // queue. This way we ensure that we reach them on every micro frame // and can do the corresponding start/complete split transactions. // ToDo: use FSTNs to correctly link non high speed interrupt transfers - interval = 1; + if (pipe->Speed() == USB_SPEED_LOWSPEED) { + // Low speed devices can't be polled faster than 8ms, so just use + // that. + interval = 4; + } else + interval = 1; // For now we also force start splits to be in micro frame 0 and // complete splits to be in micro frame 2, 3 and 4.