Skip to content
  • Alan Stern's avatar
    USB: complain if userspace resets an active endpoint · f080a51b
    Alan Stern authored
    
    
    It is an error for a driver to call usb_clear_halt() or
    usb_reset_endpoint() while there are URBs queued for the endpoint,
    because the end result is not well defined.  At the time the endpoint
    gets reset, it may or may not be actively running.
    
    As far as I know, no kernel drivers do this.  But some userspace
    drivers do, and it seems like a good idea to bring this error to their
    attention.
    
    This patch adds a warning to the kernel log whenever a program invokes
    the USBDEVFS_CLEAR_HALT or USBDEVFS_RESETEP ioctls at an inappropriate
    time, and includes the name of the program.  This will make it clear
    that any subsequent errors are not due to the misbehavior of a kernel
    driver.
    
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Suggested-by: default avatarBjørn Mork <bjorn@mork.no>
    CC: Stanislaw Gruszka <sgruszka@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f080a51b