From: Mike Frysinger Date: Tue, 10 Feb 2009 15:23:05 -0500 Subject: [U-Boot] [PATCH] musb: add timeout via CONFIG_MUSB_TIMEOUT In-Reply-To: <3efb10970902101211v25436d32p3ab76ba64ff5a417@mail.gmail.com> References: <1234254361-3984-1-git-send-email-vapier@gentoo.org> <3efb10970902101211v25436d32p3ab76ba64ff5a417@mail.gmail.com> Message-ID: <200902101523.07176.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 10 February 2009 15:11:55 Remy Bohmer wrote: > 2009/2/10 Mike Frysinger: > > From: Bryan Wu > > > > + 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