• Douglas Anderson's avatar
    usb: dwc2: host: Add a delay before releasing periodic bandwidth · 17dd5b64
    Douglas Anderson authored
    We'd like to be able to use HCD_BH in order to speed up the dwc2 host
    interrupt handler quite a bit.  However, according to the kernel doc for
    usb_submit_urb() (specifically the part about "Reserved Bandwidth
    Transfers"), we need to keep a reservation active as long as a device
    driver keeps submitting.  That was easy to do when we gave back the URB
    in the interrupt context: we just looked at when our queue was empty and
    released the reserved bandwidth then.  ...but now we need a little more
    complexity.
    
    We'll follow EHCI's lead in commit 9118f9eb ("USB: EHCI: improve
    interrupt qh unlink") and add a 5ms delay.  Since we don't have a whole
    timer infrastructure in dwc2, we'll just add a timer per QH.  The
    overhead for this is very small.
    
    Note that the dwc2 scheduler is pretty broken (see future patches to fix
    it).  This patch attempts to replicate all old behavior and just add the
    proper delay.
    Acked-by: default avatarJohn Youn <johnyoun@synopsys.com>
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
    Tested-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
    17dd5b64
hcd.h 25.8 KB