Skip to content

Commit

Permalink
uhci: Raise interrupt when requested even for non active tds
Browse files Browse the repository at this point in the history
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 <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 883bca7)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
jwrdegoede authored and mdroth committed Nov 30, 2012
1 parent 5af7caa commit 85c91ea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hw/usb/hcd-uhci.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 85c91ea

Please sign in to comment.