ehci: Set int flag on a short input packet
authorHans de Goede <hdegoede@redhat.com>
Wed, 24 Oct 2012 16:14:00 +0000 (18:14 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 25 Oct 2012 07:08:09 +0000 (09:08 +0200)
According to 4.15.1.2 an interrupt must be raised when a short packet
is received. If we don't do this it may take a significant time for
the guest to notice a short trasnfer has completed, since only the last td
will have its IOC flag set, and a short transfer may complete in an earlier
packet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ehci.c

index 82f4dbd..8b4e3c8 100644 (file)
@@ -1508,6 +1508,10 @@ static void ehci_execute_complete(EHCIQueue *q)
 
         if (tbytes && p->pid == USB_TOKEN_IN) {
             tbytes -= p->usb_status;
+            if (tbytes) {
+                /* 4.15.1.2 must raise int on a short input packet */
+                ehci_raise_irq(q->ehci, USBSTS_INT);
+            }
         } else {
             tbytes = 0;
         }