]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: gadget: replace mdelay with udelay in the busy loop
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 29 Aug 2011 14:46:38 +0000 (16:46 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 9 Sep 2011 10:02:13 +0000 (13:02 +0300)
commita917aaba8039574aa21738d8451747500b02adaa
treebf72c276a653ee677fa32514f241010239da4c9a
parent4d951b36eb5ba312a75855fdfe387acfd901bdff
usb: dwc3: gadget: replace mdelay with udelay in the busy loop

There are two spots where we wait until the HW finishes processing a
certain command. Initially we had a few problems and we used 500ms as a
limit to be on a the safe side. Paul Zimmerman mentioned this is little too
much. After a debugging session, we noticed that we hardly ever go over 20us
and didn't pass 30usec so far. Using mdelay() seems way overloaded.

Giving the current numbers 500usec as the upper limit is more than  enough.
Should it ever timeout then something is definitely wrong.

While here, also replace the type with u32 since long does not really
fit here.

Cc: Paul Zimmerman <paul.zimmerman@synopsys.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c