From 03d5910e49f442a85579d31b1b946e0da06be924 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 16 Mar 2017 17:38:49 -0700 Subject: [PATCH] usb: dwc3: Increase polling interval for set transfer resource ep cmd Endpoint command to request resources on ep0 is take upto ~800us and this delay is observed for every new/re enumeration. As the api polls (reads the register and it happens over cnoc) for every 1us to check for completion it could result in congestion on cnoc. Hence increase polling interval from 1us to 20us for this endpoint command. Change-Id: I6d738b46a47b00105289e8f07b8fe0883a3fda44 Signed-off-by: Hemant Kumar --- drivers/usb/dwc3/gadget.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7a279db521ca..82fe26822582 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -388,8 +388,10 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, } return -ETIMEDOUT; } - - udelay(1); + if ((cmd & DWC3_DEPCMD_SETTRANSFRESOURCE)) + udelay(20); + else + udelay(1); } while (1); }