summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2015-03-03 17:32:12 +0100
committerMarek Vasut <marex@denx.de>2015-04-14 05:48:12 +0200
commit137f7c590d37279f49caf4d3152a0a7d12f01831 (patch)
treee5d8de9bd344ace2fc0b5e15572bf8386821643a /drivers/usb/dwc3/gadget.c
parent16bece51c58a7758309918daecdc0c4bb45e271b (diff)
downloadblackbird-obmc-uboot-137f7c590d37279f49caf4d3152a0a7d12f01831.tar.gz
blackbird-obmc-uboot-137f7c590d37279f49caf4d3152a0a7d12f01831.zip
usb: dwc3: optimize interrupt loop
There is no point in calling dwc3_thread_interrupt() if no event is pending. There is also no point in flushing event cache in EVERY loop iteration. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 7c342c63ec..eb31cd93d6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2683,6 +2683,17 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
*/
void dwc3_gadget_uboot_handle_interrupt(struct dwc3 *dwc)
{
- dwc3_interrupt(0, dwc);
- dwc3_thread_interrupt(0, dwc);
+ int ret = dwc3_interrupt(0, dwc);
+
+ if (ret == IRQ_WAKE_THREAD) {
+ int i;
+ struct dwc3_event_buffer *evt;
+
+ for (i = 0; i < dwc->num_event_buffers; i++) {
+ evt = dwc->ev_buffs[i];
+ dwc3_flush_cache((int)evt->buf, evt->length);
+ }
+
+ dwc3_thread_interrupt(0, dwc);
+ }
}
OpenPOWER on IntegriCloud