USB: EHCI: improve ehci_endpoint_disable
authorMing Lei <ming.lei@canonical.com>
Wed, 3 Jul 2013 14:53:09 +0000 (22:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 18:43:48 +0000 (11:43 -0700)
commit35371e4fbc3e1863a6e7a79b8c17c25cc96a1380
treeae3963c8738008c603176eb0e86eb4dbe908f58a
parent85721d45261c4be684730c7509a59daa6cda30d8
USB: EHCI: improve ehci_endpoint_disable

The patch does the below improvement:

- think QH_STATE_COMPLETING as unlinking state since all URBs on the
endpoint should be in unlinking or unlinked when doing endpoint_disable()

- add "WARN_ON(!list_empty(&qh->qtd_list));" if qh->qh_state is
QH_STATE_LINKED because there shouldn't be any active transfer in qh

- when qh->qh_state is QH_STATE_LINKED, the QH(async or periodic)
should be in its corresponding list, so the search through the async
list isn't necessary.

- unlink periodic QH to speed up unlinking if the QH is in linked
state

Basically, only the last one is related with this patchset because
the assumption of "periodic qh self-unlinks on empty" isn't true
any more when we introduce unlink-wait for periodic qh.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-hcd.c