From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMH7w-0002je-Uj for qemu-devel@nongnu.org; Thu, 11 Oct 2012 07:40:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMH7q-0008Om-06 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 07:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMH7p-0008Nk-N3 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 07:40:25 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9BBeO5X014147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Oct 2012 07:40:24 -0400 From: Gerd Hoffmann Date: Thu, 11 Oct 2012 13:40:22 +0200 Message-Id: <1349955622-15183-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1349955622-15183-1-git-send-email-kraxel@redhat.com> References: <1349955622-15183-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] uhci: Raise interrupt when requested even for non active tds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede According to the spec we must raise an interrupt when one is requested even for non active tds. Linux depends on this, for bulk transfers it runs an inactivity timer to work around a bug in early uhci revisions, when we take longer then 200 ms to process a packet, this timer goes of, and as part of the handling Linux then unlinks the qh, and relinks it after the frindex has increased by atleast 1, the problem is Linux only checks for the frindex increases on an interrupt, and we don't send that, causing the qh to go inactive for more then 32 frames, at which point we consider the packet cancelled. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index cdc8bc3..c2f08e3 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -826,8 +826,16 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, USBEndpoint *ep; /* Is active ? */ - if (!(td->ctrl & TD_CTRL_ACTIVE)) + if (!(td->ctrl & TD_CTRL_ACTIVE)) { + /* + * ehci11d spec page 22: "Even if the Active bit in the TD is already + * cleared when the TD is fetched ... an IOC interrupt is generated" + */ + if (td->ctrl & TD_CTRL_IOC) { + *int_mask |= 0x01; + } return TD_RESULT_NEXT_QH; + } async = uhci_async_find_td(s, addr, td); if (async) { -- 1.7.1