linux-uconsole/drivers/usb/core
Alan Stern e17805417b USB: usbfs: allow URBs to be reaped after disconnection
commit 3f2cee73b6 upstream.

The usbfs API has a peculiar hole: Users are not allowed to reap their
URBs after the device has been disconnected.  There doesn't seem to be
any good reason for this; it is an ad-hoc inconsistency.

The patch allows users to issue the USBDEVFS_REAPURB and
USBDEVFS_REAPURBNDELAY ioctls (together with their 32-bit counterparts
on 64-bit systems) even after the device is gone.  If no URBs are
pending for a disconnected device then the ioctls will return -ENODEV
rather than -EAGAIN, because obviously no new URBs will ever be able
to complete.

The patch also adds a new capability flag for
USBDEVFS_GET_CAPABILITIES to indicate that the reap-after-disconnect
feature is supported.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Chris Dickens <christopher.a.dickens@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 09:29:47 -07:00
..
buffer.c usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN 2015-03-06 14:40:51 -08:00
config.c usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests 2014-03-23 21:38:15 -07:00
devices.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
devio.c USB: usbfs: allow URBs to be reaped after disconnection 2015-08-03 09:29:47 -07:00
driver.c USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume 2014-06-11 12:03:26 -07:00
endpoint.c usb/endpoint: Set release callback in the struct device_type instead of in the device itself directly 2012-08-20 14:38:08 -07:00
file.c USB: rename the usb misc class from "usb" to "usbmisc" 2012-06-13 15:37:13 -07:00
generic.c USB: avoid error messages when a device is disconnected 2013-03-28 11:05:52 -07:00
hcd-pci.c USB: fix crash during hotplug of PCI USB controller card 2014-05-06 07:55:29 -07:00
hcd.c USB: fix use-after-free bug in usb_hcd_unlink_urb() 2015-03-06 14:40:51 -08:00
hub.c usb: core: hub: use new USB_RESUME_TIMEOUT 2015-05-06 21:56:23 +02:00
hub.h USB: global suspend and remote wakeup don't mix 2013-08-04 16:50:50 +08:00
Kconfig USB: remove remaining instances of USB_SUSPEND 2013-05-15 13:44:44 -04:00
Makefile usb: Add driver/usb/core/(port.c,hub.h) files 2013-01-18 15:49:00 -08:00
message.c usb/core: consider link speed while looking at bMaxPower 2013-01-11 16:16:01 -08:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
port.c usb: Don't fail port power resume on device disconnect. 2013-09-26 17:18:12 -07:00
quirks.c usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 2014-12-06 15:05:48 -08:00
sysfs.c USB: remove CONFIG_USB_SUSPEND option 2013-03-28 11:10:22 -07:00
urb.c USB: fix urb-poison imbalance 2013-03-25 13:48:27 -07:00
usb-acpi.c usb/acpi: binding xhci root hub usb port with ACPI 2013-03-25 10:39:17 -07:00
usb.c usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN 2015-03-06 14:40:51 -08:00
usb.h USB: unbind all interfaces before rebinding any 2014-05-06 07:55:32 -07:00