USB: EHCI: unlink one async QH at a time
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 25 Jan 2013 21:54:22 +0000 (16:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 21:58:20 +0000 (13:58 -0800)
commit6e0c3339a6f19d748f16091d0a05adeb1e1f822b
tree0afaafdaaaca7df3362dde760b7d0273f508f04f
parent55bcdce8a8228223ec4d17d8ded8134ed265d2c5
USB: EHCI: unlink one async QH at a time

This patch (as1648) fixes a regression affecting nVidia EHCI
controllers.  Evidently they don't like to have more than one async QH
unlinked at a time.  I can't imagine how they manage to mess it up,
but at least one of them does.

The patch changes the async unlink logic in two ways:

Each time an IAA cycle is started, only the first QH on the
async unlink list is handled (rather than all of them).

Async QHs do not all get unlinked as soon as they have been
empty for long enough.  Instead, only the last one (i.e., the
one that has been on the schedule the longest) is unlinked,
and then only if no other unlinks are in progress at the time.

This means that when multiple QHs are empty, they won't be unlinked as
quickly as before.  That's okay; it won't affect correct operation of
the driver or add an excessive load.  Multiple unlinks tend to be
relatively rare in any case.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Cc: stable <stable@vger.kernel.org> # 3.6
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-q.c