• Ming Lei's avatar
    USB: EHCI: improve ehci_endpoint_disable · 35371e4f
    Ming Lei authored
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    35371e4f
ehci-hcd.c 37.7 KB