[U-Boot] [PATCH] musb: add timeout via CONFIG_MUSB_TIMEOUT
Mike Frysinger
vapier at gentoo.org
Tue Feb 10 21:23:05 CET 2009
On Tuesday 10 February 2009 15:11:55 Remy Bohmer wrote:
> 2009/2/10 Mike Frysinger:
> > From: Bryan Wu <bryan.wu at analog.com>
> >
> > + int timeout = CONFIG_MUSB_TIMEOUT;
> >
> > while (result > 0) {
> > csr = readw(&musbr->txcsr);
> > @@ -152,7 +153,17 @@ static int wait_until_ep0_ready(struct usb_device
> > *dev, u32 bit_mask) }
> > break;
> > }
> > +
> > + /* Check the timeout */
> > + if (--timeout)
> > + udelay(1);
>
> Hmm, I might be mistaken, but looking at this patch you seem to want
> to timeout at CONFIG_MUSB_TIMEOUT,
> but actually the timeout ends at CONFIG_MUSB_TIMEOUT-1.
> Shouldn't it be: if (timeout--) instead of if (--timeout) ???
> (some remark applies to all instances in this patch...)
looks that way. i was hoping for feedback about the concept from the TI guys
who wrote the musb driver to see if this method is ok or they prefer something
different ;).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090210/a895db74/attachment.pgp
More information about the U-Boot
mailing list