From: Hans de Goede Date: Mon, 10 Sep 2012 10:44:10 +0000 (+0200) Subject: ehci: Fix interrupts stopping when Interrupt Threshold Control is 8 X-Git-Tag: v1.2.1~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29ecaa26a83753e67bc8ba7cacf08d3948e868af;p=thirdparty%2Fqemu.git ehci: Fix interrupts stopping when Interrupt Threshold Control is 8 If Interrupt Threshold Control is 8 or a multiple of 8, then s->usbsts_frindex can become exactly 0x4000, at which point (s->usbsts_frindex > s->frindex) will never become true, as s->usbsts_frindex will not be lowered / reset in this case. This patch fixes this. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann (cherry picked from commit ffa1f2e088eb7e3d57f2fc35f21e7bdb23e592c5) Signed-off-by: Michael Roth --- diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index f5ba8e14690..54273d777b6 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2413,7 +2413,7 @@ static void ehci_update_frindex(EHCIState *ehci, int frames) if (ehci->frindex == 0x00004000) { ehci_raise_irq(ehci, USBSTS_FLR); ehci->frindex = 0; - if (ehci->usbsts_frindex > 0x00004000) { + if (ehci->usbsts_frindex >= 0x00004000) { ehci->usbsts_frindex -= 0x00004000; } else { ehci->usbsts_frindex = 0;