summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Mosberger <davidm@egauge.net>2016-03-08 14:42:48 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-02 17:20:43 +0200
commitee3326f4860576a0fe568dea0ce9fc2e7297ca6d (patch)
treeb2abfd8fe9f94e012e348a2cc076f97e8cb56ca2 /include/linux
parent414ad945a625b166fd8ccd1ace94ecedd5dc6fac (diff)
drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit.
commit 98b74b0ee57af1bcb6e8b2e76e707a71c5ef8ec9 upstream. 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>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions