Skip to content

Commit

Permalink
USB: OHCI: workaround for hardware bug: retired TDs not added to the …
Browse files Browse the repository at this point in the history
…Done Queue

commit 50ce5c0 upstream.

This patch (as1636) is a partial workaround for a hardware bug
affecting OHCI controllers by NVIDIA at least, maybe others too.  When
the controller retires a Transfer Descriptor, it is supposed to add
the TD onto the Done Queue.  But sometimes this doesn't happen, with
the result that ohci-hcd never realizes the corresponding transfer has
finished.  Symptoms can vary; a typical result is that USB audio stops
working after a while.

The patch works around the problem by recognizing that TDs are always
processed in order.  Therefore, if a later TD is found on the Done
Queue than all the earlier TDs for the same endpoint must be finished
as well.

Unfortunately this won't solve the problem in cases where the missing
TD is the last one in the endpoint's queue.  A complete fix would
require a signficant amount of change to the driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Dec 17, 2012
1 parent efcda31 commit efda03c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/usb/host/ohci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,25 @@ dl_done_list (struct ohci_hcd *ohci)

while (td) {
struct td *td_next = td->next_dl_td;
struct ed *ed = td->ed;

/*
* Some OHCI controllers (NVIDIA for sure, maybe others)
* occasionally forget to add TDs to the done queue. Since
* TDs for a given endpoint are always processed in order,
* if we find a TD on the donelist then all of its
* predecessors must be finished as well.
*/
for (;;) {
struct td *td2;

td2 = list_first_entry(&ed->td_list, struct td,
td_list);
if (td2 == td)
break;
takeback_td(ohci, td2);
}

takeback_td(ohci, td);
td = td_next;
}
Expand Down

0 comments on commit efda03c

Please sign in to comment.