Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264971
b: refs/heads/master
c: 61d5824
h: refs/heads/master
i:
  264969: b3ac107
  264967: 4f919f3
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Felipe Balbi committed Sep 9, 2011
1 parent 9ff0c87 commit 25edf8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 624407f96f134bcd3063eb0d404fc6d41323bef8
refs/heads/master: 61d58242f634642de42d6a4098913b7254a65053
12 changes: 4 additions & 8 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
unsigned cmd, struct dwc3_gadget_ep_cmd_params *params)
{
struct dwc3_ep *dep = dwc->eps[ep];
unsigned long timeout = 500;
u32 timeout = 500;
u32 reg;

dev_vdbg(dwc->dev, "%s: cmd '%s' params %08x %08x %08x\n",
Expand All @@ -175,15 +175,14 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
}

/*
* XXX Figure out a sane timeout here. 500ms is way too much.
* We can't sleep here, because it is also called from
* interrupt context.
*/
timeout--;
if (!timeout)
return -ETIMEDOUT;

mdelay(1);
udelay(1);
} while (1);
}

Expand Down Expand Up @@ -1066,7 +1065,7 @@ static int dwc3_gadget_set_selfpowered(struct usb_gadget *g,
static void dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
{
u32 reg;
unsigned long timeout = 500;
u32 timeout = 500;

reg = dwc3_readl(dwc->regs, DWC3_DCTL);
if (is_on)
Expand All @@ -1085,13 +1084,10 @@ static void dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
if (reg & DWC3_DSTS_DEVCTRLHLT)
break;
}
/*
* XXX reduce the 500ms delay
*/
timeout--;
if (!timeout)
break;
mdelay(1);
udelay(1);
} while (1);

dev_vdbg(dwc->dev, "gadget %s data soft-%s\n",
Expand Down

0 comments on commit 25edf8c

Please sign in to comment.