From 8945045acc140d1a85d87c5db18bbc981b523bb3 Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Fri, 26 Feb 2016 13:17:00 +0200 Subject: [PATCH] Revert "usb: dwc3: gadget: start requests as soon as they come" This reverts commit 118694c58a32c16ca0ef24304a8e9d8c21b5082b. The reverted commit was causing 50% eunumeration failures for mass_storage gadget with the below backtrace. The commit was supposed to make dwc3 little faster. However, testing with mass storage gadget on am437x-gp-evm (with backing storage in RAM) gives no diffrence in performance with or without the patch. We choose to sacrifice any (minor) performance gain for stability. [ 73.526467] ------------[ cut here ]------------ [ 73.531230] WARNING: CPU: 0 PID: 2195 at drivers/usb/dwc3/ep0.c:306 dwc3_ep0_out_start+0x44/0x50 [dwc3]() [ 73.540854] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite ipv6 xhci_plat_hcd xhci_hcd usbcore evdev joydev dwc3 pru_rproc udc_core ti_am335x_adc kfifo_c [ 73.582299] CPU: 0 PID: 2195 Comm: irq/266-dwc3 Not tainted 4.1.18-00998-ga6a31ce #211 [ 73.590267] Hardware name: Generic AM43 (Flattened Device Tree) [ 73.596224] Backtrace: [ 73.598751] [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [ 73.606366] r6:00000000 r5:00000000 r4:20000093 r3:00000000 [ 73.612152] [] (show_stack) from [] (dump_stack+0x94/0xb4) [ 73.619448] [] (dump_stack) from [] (warn_slowpath_common+0x80/0xbc) [ 73.627585] r6:00000132 r5:bf0f6854 r4:00000000 r3:ed1cc000 [ 73.633361] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x24/0x2c) [ 73.642194] r8:00000000 r7:0000030c r6:00000000 r5:f22c5000 r4:ee494010 [ 73.649073] [] (warn_slowpath_null) from [] (dwc3_ep0_out_start+0x44/0x50 [dwc3]) [ 73.658434] [] (dwc3_ep0_out_start [dwc3]) from [] (dwc3_ep0_interrupt+0x1dc/0xae4 [dwc3]) [ 73.668570] [] (dwc3_ep0_interrupt [dwc3]) from [] (dwc3_thread_interrupt+0x7f4/0x9e4 [dwc3]) [ 73.678890] r10:ed17e380 r9:00000000 r8:00000000 r7:0000030c r6:ee494010 r5:00000004 [ 73.686847] r4:ed66e890 [ 73.689461] [] (dwc3_thread_interrupt [dwc3]) from [] (irq_thread_fn+0x24/0x3c) [ 73.698558] r10:00000000 r9:00000001 r8:ed4047c0 r7:ed13f780 r6:ed13f780 r5:00000000 [ 73.706513] r4:ed4047c0 [ 73.709094] [] (irq_thread_fn) from [] (irq_thread+0x158/0x1b8) [ 73.716795] r6:00000001 r5:00000000 r4:ed4047e0 r3:c00819f0 [ 73.722575] [] (irq_thread) from [] (kthread+0xdc/0xf8) [ 73.729578] r10:00000000 r9:00000000 r8:00000000 r7:c0081a90 r6:ed4047c0 r5:ed4045c0 [ 73.737531] r4:00000000 [ 73.740121] [] (kthread) from [] (ret_from_fork+0x14/0x2c) [ 73.747384] r7:00000000 r6:00000000 r5:c005b05c r4:ed4045c0 [ 73.753140] ---[ end trace 7a5e0f83644dd200 ]--- Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori --- drivers/usb/dwc3/gadget.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 28e85ed7588c77..ef485930da1de3 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1071,20 +1071,6 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) list_add_tail(&req->list, &dep->request_list); - /* - * If there are no pending requests and the endpoint isn't already - * busy, we will just start the request straight away. - * - * This will save one IRQ (XFER_NOT_READY) and possibly make it a - * little bit faster. - */ - if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) && - !usb_endpoint_xfer_int(dep->endpoint.desc) && - !(dep->flags & DWC3_EP_BUSY)) { - ret = __dwc3_gadget_kick_transfer(dep, 0, true); - goto out; - } - /* * There are a few special cases: *