Skip to content
  • Nicolas Saenz Julienne's avatar
    usb: hub: add retry routine after intr URB submit error · 8eb58994
    Nicolas Saenz Julienne authored
    
    
    The hub sends hot-plug events to the host trough it's interrupt URB. The
    driver takes care of completing the URB and re-submitting it. Completion
    errors are handled in the hub_event() work, yet submission errors are
    ignored, rendering the device unresponsive. All further events are lost.
    
    It is fairly hard to find this issue in the wild, since you have to time
    the USB hot-plug event with the URB submission failure. For instance it
    could be the system running out of memory or some malfunction in the USB
    controller driver. Nevertheless, it's pretty reasonable to think it'll
    happen sometime. One can trigger this issue using eBPF's function
    override feature (see BCC's inject.py script).
    
    This patch adds a retry routine to the event of a submission error. The
    HUB driver will try to re-submit the URB once every second until it's
    successful or the HUB is disconnected.
    
    As some USB subsystems already take care of this issue, the
    implementation was inspired from usbhid/hid_core.c's.
    
    Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
    Reviewed-by: default avatarOliver Neukum <oneukum@suse.com>
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    8eb58994