dwc3: gadget: Increase retry count from 500 to 3000 iterations

DWC3 XMIT_DEV command is timing out for USB function wakeup functionality
with current 500 iterations (i.e. timeout comes around 300us). USB DWC3
controller shall take more time to process this particular command. Hence
increase retry count from 500 to 3000 iterations (i.e same as dwc3 endpoint
command timeout value) to have sucessful USB function wakeup functionality.

Change-Id: I1b5a9dd64a01ad9592a04c275beef77eaee523be
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
Mayank Rana 2021-01-28 14:10:24 -08:00 • committed by Gerrit - the friendly Code Review server
commit 7254686210

View file

@ -313,6 +313,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
spin_lock(&dwc->lock);
}
#define DWC_CMD_TIMEOUT 3000
/**
* dwc3_send_gadget_generic_command - issue a generic command for the controller
* @dwc: pointer to the controller context
@ -324,7 +325,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
*/
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
{
u32 timeout = 500;
u32 timeout = DWC_CMD_TIMEOUT;
int status = 0;
int ret = 0;
u32 reg;
@ -366,7 +367,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
{
const struct usb_endpoint_descriptor *desc = dep->endpoint.desc;
struct dwc3 *dwc = dep->dwc;
u32 timeout = 3000;
u32 timeout = DWC_CMD_TIMEOUT;
u32 saved_config = 0;
u32 reg;