From 70eb60e4ba1ab9ed0c663c134e30e17313f77030 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 4 Mar 2012 11:57:50 +0100
Subject: [PATCH 28/35] usb-ehci: Any packet completion except for NAK should
 set the interrupt

RH-Author: Hans de Goede <hdegoede@redhat.com>
Message-id: <1330862278-22314-14-git-send-email-hdegoede@redhat.com>
Patchwork-id: 37928
O-Subject: [PATCH 13/21] usb-ehci: Any packet completion except for NAK should set the interrupt
Bugzilla: 758104
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Alon Levy <alevy@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT get
sets then if the td has its IOC bit set USBINT should be set as well.

This means that for any status except for USB_RET_NAK we should set
USBINT if the IOC bit is set.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Upstream commit: 2763cbc751c494dd2f58f902ad80a8048f9cfd7b
Upstream: http://patchwork.ozlabs.org/patch/144363/
(waiting for next usb pull request)
---
 hw/usb-ehci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/usb-ehci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 11e9131..ecd6a70 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1329,7 +1329,7 @@ err:
     q->qh.token ^= QTD_TOKEN_DTOGGLE;
     q->qh.token &= ~QTD_TOKEN_ACTIVE;
 
-    if ((q->usb_status >= 0) && (q->qh.token & QTD_TOKEN_IOC)) {
+    if ((q->usb_status != USB_RET_NAK) && (q->qh.token & QTD_TOKEN_IOC)) {
         ehci_record_interrupt(q->ehci, USBSTS_INT);
     }
 }
-- 
1.7.7.6

