• A
    USB: EHCI: fix two new bugs related to Clear-TT-Buffer · 7a0f0d95
    Alan Stern 提交于
    This patch (as1273) fixes two(!) bugs introduced by the new
    Clear-TT-Buffer implementation in ehci-hcd.
    
    	It is now possible for an idle QH to have some URBs on its
    	queue -- this will happen if a Clear-TT-Buffer is pending for
    	the QH's endpoint.  Consequently we should not issue a warning
    	when someone tries to unlink an URB from an idle QH; instead
    	we should process the request immediately.
    
    	The refcounts for QHs could get messed up, because
    	submit_async() would increment the refcount when calling
    	qh_link_async() and qh_link_async() would then refuse to link
    	the QH into the schedule if a Clear-TT-Buffer was pending.
    	Instead we should increment the refcount only when the QH
    	actually is added to the schedule.  The current code tries to
    	be clever by leaving the refcount alone if an unlink is
    	immediately followed by a relink; the patch changes this to an
    	unconditional decrement and increment (although they occur in
    	the opposite order).
    Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
    CC: David Brownell <david-b@pacbell.net>
    Tested-by: NManuel Lauss <manuel.lauss@gmail.com>
    Tested-by: NMatthijs Kooijman <matthijs@stdin.nl>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    
    
    7a0f0d95
ehci-hcd.c 33.3 KB