]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: complain if userspace resets an active endpoint
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 20 Feb 2014 15:49:30 +0000 (10:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Feb 2014 01:07:53 +0000 (17:07 -0800)
commitf080a51bef2caa9b0f647dc430bc608d5723ac29
treed10cd4984eb5988cde6b19c4eb5f082204e3d9e0
parent42d182124801573e06284200d81c3963962e753d
USB: complain if userspace resets an active endpoint

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: Alan Stern <stern@rowland.harvard.edu>
Suggested-by: Bjørn Mork <bjorn@mork.no>
CC: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c