[PATCH 2/2] drivers: usb: core: Minimize irq disabling in usb_sg_cancel()

2016-03-08 Thread David Mosberger-Tang
From: David Mosberger Restructure usb_sg_cancel() so we don't have to disable interrupts while cancelling the URBs. Suggested-by: Alan Stern Signed-off-by: David Mosberger --- drivers/usb/core/message.c | 37 + 1 file changed, 17 insertions(+), 20 deletions

[PATCH 1/2] drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit.

2016-03-08 Thread David Mosberger-Tang
From: David Mosberger 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

Re: [PATCH] drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit.

2016-03-08 Thread David Mosberger-Tang
Alan, Thanks for your feedback! > This should now be GFP_NOIO. OK, I updated the patch to fix that. Good catch. > Strictly speaking, this loop should run backward. Then the > spin_unlock() could be replaced with spin_unlock_irqrestore(). Good idea. A separate patch for this is included.

high interrupt latency due to usb_sg_wait()

2016-03-08 Thread David Mosberger-Tang
[Second transmission; hopefully this one will go through...] Alan, How about the attached patch? Works for me but definitely needs more review and testing. --david -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org Mo

[PATCH] drivers: usb: core: Don't disable irqs in usb_sg_wait() during URB submit.

2016-03-08 Thread David Mosberger-Tang
From: David Mosberger 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