提交 ffa1f2e0 编写于 作者: H Hans de Goede 提交者: Gerd Hoffmann

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: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 3e4f910c
...@@ -2413,7 +2413,7 @@ static void ehci_update_frindex(EHCIState *ehci, int frames) ...@@ -2413,7 +2413,7 @@ static void ehci_update_frindex(EHCIState *ehci, int frames)
if (ehci->frindex == 0x00004000) { if (ehci->frindex == 0x00004000) {
ehci_raise_irq(ehci, USBSTS_FLR); ehci_raise_irq(ehci, USBSTS_FLR);
ehci->frindex = 0; ehci->frindex = 0;
if (ehci->usbsts_frindex > 0x00004000) { if (ehci->usbsts_frindex >= 0x00004000) {
ehci->usbsts_frindex -= 0x00004000; ehci->usbsts_frindex -= 0x00004000;
} else { } else {
ehci->usbsts_frindex = 0; ehci->usbsts_frindex = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册