linux/drivers/usb/core
David Mosberger 98b74b0ee5 drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit.
usb_submit_urb() may take quite long to execute.  For example, a
single sg list may have 30 or more entries, possibly leading to that
many calls to DMA-map pages.  This can cause interrupt latency of
several hundred micro-seconds.

Avoid the problem by releasing the io->lock spinlock and re-enabling
interrupts before calling usb_submit_urb().  This opens races with
usb_sg_cancel() and sg_complete().  Handle those races by using
usb_block_urb() to stop URBs from being submitted after
usb_sg_cancel() or sg_complete() with error.

Note that usb_unlink_urb() is guaranteed to return -ENODEV if
!io->urbs[i]->dev and since the -ENODEV case is already handled,
we don't have to check for !io->urbs[i]->dev explicitly.

Before this change, reading 512MB from an ext3 filesystem on a USB
memory stick showed a throughput of 12 MB/s with about 500 missed
deadlines.

With this change, reading the same file gave the same throughput but
only one or two missed deadlines.

Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-26 15:21:41 -07:00
..
buffer.c usb: core: Allow compilation on platforms where NO_DMA=y 2016-02-20 20:22:55 -08:00
config.c usb: fix regression in SuperSpeed endpoint descriptor parsing 2016-03-30 21:57:58 -07:00
devices.c usb: core: rename mutex usb_bus_list_lock to usb_bus_idr_lock 2016-02-06 21:55:57 -08:00
devio.c usb: devio: Add ioctl to disallow detaching kernel USB drivers. 2016-03-05 12:05:01 -08:00
driver.c USB: usb_driver_claim_interface: add sanity checking 2016-03-18 09:19:02 -07:00
endpoint.c usb: endpoint: convert spaces to tabs 2015-08-14 16:50:36 -07:00
file.c usb: core: use kbasename() instead of open-coded variant 2016-01-24 20:37:47 -08:00
generic.c staging: usbip: convert usbip-host driver to usb_device_driver 2014-02-07 10:54:30 -08:00
hcd-pci.c usb: hcd: out of bounds access in for_each_companion 2016-04-13 12:06:18 -07:00
hcd.c usb: core: Allow compilation on platforms where NO_DMA=y 2016-02-20 20:22:55 -08:00
hub.c hub: admit devices are SS+ 2016-04-26 15:04:38 -07:00
hub.h usb: Support USB 3.1 extended port status request 2016-01-24 20:16:52 -08:00
Kconfig usb: kconfig: fix warning of select USB_OTG 2015-11-19 16:31:42 -08:00
Makefile USB: core: let USB device know device node 2016-03-05 12:05:01 -08:00
message.c drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit. 2016-04-26 15:21:41 -07:00
notify.c
of.c USB: core: let USB device know device node 2016-03-05 12:05:01 -08:00
otg_whitelist.h usb: otg_whitelist: remove whitespace 2015-08-14 16:50:36 -07:00
port.c More power management and ACPI updates for v4.5-rc1 2016-01-20 19:06:49 -08:00
quirks.c USB: add quirk for devices with broken LPM 2015-12-11 15:40:51 -08:00
sysfs.c usb: no locking for reading descriptors in sysfs 2016-02-03 13:29:12 -08:00
urb.c usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices 2016-01-24 20:16:52 -08:00
usb-acpi.c usb: find internal hub tier mismatch via acpi 2014-05-27 16:38:52 -07:00
usb.c usb/core: usb_alloc_dev(): fix setting of ->portnum 2016-03-18 09:19:02 -07:00
usb.h usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices 2016-01-24 20:16:52 -08:00