linux_dsm_epyc7002/drivers/usb/core
Alan Stern 5cce438298 USB: remove race condition in usbfs/libusb when using reap-after-disconnect
Hans de Goede has reported a difficulty in the Linux port of libusb.
When a device is removed, the poll() system call in usbfs starts
returning POLLERR as soon as udev->state is set to
USB_STATE_NOTATTACHED, but the outstanding URBs are not available for
reaping until some time later (after usbdev_remove() has been called).
This is awkward for libusb or other usbfs clients, although not an
insuperable problem.

At any rate, it's easy to change usbfs so that it returns POLLHUP as
soon as the state becomes USB_STATE_NOTATTACHED but it doesn't return
POLLERR until after the outstanding URBs have completed.  That's what
this patch does; it uses the fact that ps->list is always on the
dev->filelist list until usbdev_remove() takes it off, which happens
after all the outstanding URBs have been cancelled.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-09 16:14:18 +02:00
..
buffer.c
config.c USB: validate wMaxPacketValue entries in endpoint descriptors 2016-08-09 16:14:18 +02:00
devices.c
devio.c USB: remove race condition in usbfs/libusb when using reap-after-disconnect 2016-08-09 16:14:18 +02:00
driver.c
endpoint.c
file.c
generic.c
hcd-pci.c
hcd.c USB: don't free bandwidth_mutex too early 2016-06-27 08:39:39 -07:00
hub.c USB: hub: change the locking in hub_activate 2016-08-09 15:45:59 +02:00
hub.h
Kconfig
Makefile
message.c usbnet: move the CDC parser into USB core 2016-07-18 08:46:57 -07:00
notify.c
of.c
otg_whitelist.h
port.c
quirks.c usb: quirks: Add no-lpm quirk for Elan 2016-07-14 11:58:46 +09:00
sysfs.c
urb.c
usb-acpi.c
usb.c Merge 4.6-rc7 into usb-next 2016-05-09 09:29:13 +02:00
usb.h